Skip to content

[JSONSerialization] Add ability to emit 'null' value. #14258

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 3 commits into from
Jan 30, 2018

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jan 30, 2018

Added NullableTraits template to represent potential null value.

Also, modified outputs for empty object and array values in pretty-print mode.
Now, they are emitted as {} and [] instead of:

{

}

and

[

]

@rintaro
Copy link
Member Author

rintaro commented Jan 30, 2018

@swift-ci Please smoke test

@rintaro rintaro merged commit 39f8978 into swiftlang:master Jan 30, 2018
@rintaro rintaro deleted the basic-json-null branch January 30, 2018 15:46
@jrose-apple
Copy link
Contributor

:-( Always sad to see improvements to JSONSerialization rather than merging it back into LLVM's YAML support.

@rintaro
Copy link
Member Author

rintaro commented Feb 1, 2018

Ah, I wasn't aware that swift::json is originated from llvm::yaml.

@jrose-apple
Copy link
Contributor

A long time ago. There was always a task of merging it back and making it an option in YAML serialization, but…

…actually…

…okay, filed SR-6891. Maybe someone will pick it up.

@jrose-apple
Copy link
Contributor

Don't worry about this when actually fixing bugs, though!

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.

2 participants