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

ByteBuffer: add direct Codable support #1153

Merged
merged 1 commit into from Oct 17, 2019

Conversation

@weissi
Copy link
Member

weissi commented Oct 1, 2019

Motivation:

So far, it has been harder than necessary to use Codable & ByteBuffer.
These new APIs should simplify that and allow future optimisations.

Modifications:

Add new API to use JSONEncoder and JSONDecoder directly with
ByteBuffer.

Result:

Easier Codable + ByteBuffer usage.

@weissi weissi requested a review from Lukasa Oct 1, 2019
@weissi weissi added this to the 2.9.0 milestone Oct 1, 2019
@Lukasa
Lukasa approved these changes Oct 1, 2019
@weissi

This comment has been minimized.

Copy link
Member Author

weissi commented Oct 1, 2019

@swift-nio-bot test this please

@tomerd

This comment has been minimized.

Copy link
Member

tomerd commented Oct 1, 2019

NIOFoundationCompatTests source missing?

@weissi weissi force-pushed the weissi:jw-bytebuffer-codable branch 2 times, most recently from 3864a61 to 808f38b Oct 1, 2019
@weissi

This comment has been minimized.

Copy link
Member Author

weissi commented Oct 11, 2019

@swift-nio-bot test this please

@weissi weissi force-pushed the weissi:jw-bytebuffer-codable branch 2 times, most recently from a5b3ffd to 470f16b Oct 12, 2019
@weissi weissi requested a review from glbrntt Oct 17, 2019
@weissi weissi force-pushed the weissi:jw-bytebuffer-codable branch from 09da436 to 050f1c0 Oct 17, 2019
@weissi weissi requested a review from glbrntt Oct 17, 2019
Copy link
Contributor

glbrntt left a comment

Looks good -- just nits!

Motivation:

So far, it has been harder than necessary to use Codable & ByteBuffer.
These new APIs should simplify that and allow future optimisations.

Modifications:

Add new API to use `JSONEncoder` and `JSONDecoder` directly with
`ByteBuffer`.

Result:

Easier Codable + ByteBuffer usage.
@weissi weissi force-pushed the weissi:jw-bytebuffer-codable branch from 6968b70 to 0c9fcd3 Oct 17, 2019
@weissi weissi merged commit 8dd62cb into apple:master Oct 17, 2019
4 checks passed
4 checks passed
pull request validation (5.0) Build finished.
Details
pull request validation (5.1) Build finished.
Details
pull request validation (api breakage) Build finished.
Details
pull request validation (sanity) Build finished.
Details
@weissi weissi deleted the weissi:jw-bytebuffer-codable branch Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.