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

Custom JSON encoding options #112

Merged
merged 3 commits into from
Jul 29, 2024
Merged

Conversation

czechboy0
Copy link
Contributor

Motivation

A second attempt at apple/swift-openapi-generator#605, this time less open-ended than #111.

Only allow customizing the JSON encoding options.

Modifications

  • Added a JSONEncodingOptions option set.
  • Added a corresponding property on the Configuration struct.
  • Piped the value to the underlying JSONEncoder.

Result

Allows users to customize the JSON encoding options.

Test Plan

Added unit tests.

@czechboy0 czechboy0 requested a review from simonjbeaumont July 29, 2024 15:31
@simonjbeaumont simonjbeaumont added the 🆕 semver/minor Adds new public API. label Jul 29, 2024
Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @czechboy0, LGTM.

I think this is probably the most pragmatic approach for now. We can always revisit a full-blown encoder abstraction in the future when there's a real need for it.

@czechboy0 czechboy0 merged commit 26e8ae3 into apple:main Jul 29, 2024
8 checks passed
@czechboy0 czechboy0 deleted the hd-custom-json-options branch July 30, 2024 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants