Skip to content

[4.0] JSONSerialization: Add missing numeric types #1255

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

Conversation

ianpartridge
Copy link
Contributor

Cherry-pick #1197 to 4.0 branch.

- Add support for Int8/Int16/Int32/Int64, UInt8/UInt16/UInt32/UInt64,
  Decimal and NSDecimalNumber.

- Improve serializeInteger performance to avoid overall speed regression.

- Move JSONSerialization tests into correct testfile and use Int64 to stop tests
  breaking on 32bit platforms.

- Add tests for isValidJSONObject() to test the support of new types.

- Add tests for Float, Double, Decimal and NSDecimalNumber.

JSONSerialization: Update error message to match Darwin

JSONSerialization PR review fixes
@ianpartridge
Copy link
Contributor Author

@swift-ci please test

@ianpartridge ianpartridge merged commit 0fc9b9c into swiftlang:swift-4.0-branch Oct 9, 2017
@ianpartridge ianpartridge deleted the jsonserialization-4.0 branch October 9, 2017 11:22
martinknabbe added a commit to martinknabbe/SwagGen that referenced this pull request Dec 5, 2017
JSONSerialization can handle Int64 and Int32 since Swift 4. Conformance to JSONRawType makes them encodable and decodable with JSONEncodable and JSONDecodable.

swiftlang/swift-corelibs-foundation#1255
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