simatic-ax / json

Library to serialize a JSON object model into a array of character and parse a array of character for JSON elements
Other
3 stars 2 forks source link

Consider passing JsonDocument as VAR_IN_OUT #8

Open drsoran opened 2 years ago

drsoran commented 2 years ago

Couldn't we pass the `JsonDocument' as IN_OUT instead of REF_TO? This had the advantage of direct accessing it via '.' operator. Plus I do not need to be prepared for a possible 'NULL'.

https://github.com/simatic-ax/Json/blob/56789c43fda812f2fa464edbc1008a72b800e7ee/src/Elements/IJsonElement.st#L8

Didn't have checked all usages to it may be better to pass as REF_TO...🤔

sjuergen commented 2 years ago

Good point. But does it make sense to create a IJsonDocument Interface?

drsoran commented 2 years ago

Yes, would also be a way then we can stick to VAR_INPUT.