Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bugfix: Fix #218 by serializing "null" for "null" types #263

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

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Conversation

cwacek
Copy link
Owner

@cwacek cwacek commented Sep 14, 2023

  • There were two sets of similar JSON serialization logic in place. This unifies them by just making all our custom objects call for_json() which already does the right thing.
  • The actual bug is fixed by permitting None values to serialize to JSON, iff the type of the object is "null"

Aside: I still don't understand why objects with type null exist
in the JSONSchema spec, but w/e.

+ There were two sets of similar JSON serialization logic
  in place. This unifies them by just making all our custom objects
  call for_json() which already does the right thing.
+ The actual bug is fixed by permitting None values to serialize
  to JSON, iff the type of the object is "null"

Aside: I still don't understand why objects with _type_ null exist
       in the JSONSchema spec, but w/e.
@cwacek cwacek linked an issue Sep 14, 2023 that may be closed by this pull request
@cwacek cwacek merged commit 82b1fb4 into master Sep 14, 2023
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

Successfully merging this pull request may close these issues.

Add option for not removing null values on serialization
1 participant