You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some use-cases use a combination of gjson and sjson with paths deeper than just a key to alter incoming json data to be fuzzy with a schema - making it "fit" even if clients are at various levels of "compliance" vs correctness, in the spirit of "be generous in what you receive and strict with what you output".
https://github.com/cloudwego/gjson can be useful for the gjson side, but there is no corresponding sjson side. In addition, I'm curious if the ast framework could be good at holding the entire tree and making updates or additions at any level with a more convenient variant of Set, which could create objects and arrays as needed to make a place for the value to sit.
The current state of the module would seemingly require a client to, for every non-leaf key/value do a get and, if !Exists, set to the appropriate type and call either Set or Add as needed for Object v. Array. - while doable, it seems like something that could be made MUCH more convenient and a "pit of success" for clients to use properly/efficiently.
The ultimate hope would be to be able to combinations of get and set on the root structure, without having to re-parse (even lazily) the entire content over and over again, like is needed for gjson/sjson - if updates are made with sjson and return a new []byte then gjson would have to re-read that on subsequent gets to decide further updates/corrections/etc
The text was updated successfully, but these errors were encountered:
Some use-cases use a combination of gjson and sjson with paths deeper than just a key to alter incoming json data to be fuzzy with a schema - making it "fit" even if clients are at various levels of "compliance" vs correctness, in the spirit of "be generous in what you receive and strict with what you output".
https://github.com/cloudwego/gjson can be useful for the gjson side, but there is no corresponding sjson side. In addition, I'm curious if the ast framework could be good at holding the entire tree and making updates or additions at any level with a more convenient variant of Set, which could create objects and arrays as needed to make a place for the value to sit.
The current state of the module would seemingly require a client to, for every non-leaf key/value do a get and, if !Exists, set to the appropriate type and call either Set or Add as needed for Object v. Array. - while doable, it seems like something that could be made MUCH more convenient and a "pit of success" for clients to use properly/efficiently.
The ultimate hope would be to be able to combinations of get and set on the root structure, without having to re-parse (even lazily) the entire content over and over again, like is needed for gjson/sjson - if updates are made with sjson and return a new
[]byte
then gjson would have to re-read that on subsequent gets to decide further updates/corrections/etcThe text was updated successfully, but these errors were encountered: