Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain Key Order as specified in Struct? #6

Open
pixelwiz opened this issue Jul 26, 2017 · 2 comments
Open

Maintain Key Order as specified in Struct? #6

pixelwiz opened this issue Jul 26, 2017 · 2 comments

Comments

@pixelwiz
Copy link

I know key order in JSON is not relevant and can't be dependent on, but for debugging and readability purposes it would be great if the order of key/value pairs in the JSON object would be the same as the Struct from which it was serialized.

@atuttle
Copy link
Contributor

atuttle commented Aug 17, 2017

If you submit the PR then I'll consider merging it. ;)

@JamoCA
Copy link

JamoCA commented Jan 15, 2020

This should be easier to implement now that you can create ordered structs in CF2016+, right? StructNew("ordered").

Some messaging services (and JSON-to-XML APIs like Authorize.net) require JSON keys to be in a specific order. Using "ordered" would allow for the JSON objects to be faithfully serialized & deserialized in the same received order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants