feat(nullable): add Value[T]; deprecate Nullable#21
Open
frenchi wants to merge 1 commit intooapi-codegen:mainfrom
Open
feat(nullable): add Value[T]; deprecate Nullable#21frenchi wants to merge 1 commit intooapi-codegen:mainfrom
frenchi wants to merge 1 commit intooapi-codegen:mainfrom
Conversation
Introduce nullable.Value[T] as the preferred tri-state JSON field type (unspecified, null, value). Keep nullable.Nullable[T] for compatibility and mark it as deprecated. - Add Value[T] with full method set (Get, MustGet, Set, SetNull, etc.) - Add constructors: NewValue and NewNullValue - Deprecate: NewNullableWithValue, NewNullNullable - Update README to prefer Value and add migration notes - Add tests mirroring Nullable behavior for Value and constructors Note: Implemented Value as a separate generic type (not an alias) for Go 1.20 compatibility. Deprecated: - Nullable[T] (use Value[T]) - NewNullableWithValue (use NewValue) - NewNullNullable (use NewNullValue)
Member
|
Thanks, this will close #3 (I'll try and take a look at this PR in the next couple of weeks) |
Author
Thank you, I went digging for the issue reference but you beat me to it! No rush on reviewing this, thanks for your attention. |
frenchi
added a commit
to frenchi/oapi-codegen
that referenced
this pull request
Aug 27, 2025
- Switch generator to output nullable.Value[T] for nullable fields - Update schema tests to expect Value[T] - Update README to prefer nullable.Value with migration notes - Do not edit generated fixtures; regeneration will follow after library update Notes: - Requires nullable library release containing Value[T] - Regenerate test fixtures after bumping dependency Refs: oapi-codegen/nullable#21 Pending: oapi-codegen/nullable#21
|
Will this be merged? @frenchi @jamietanna |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce nullable.Value[T] as the preferred tri-state JSON field type (unspecified, null, value). Keep nullable.Nullable[T] for compatibility and mark it as deprecated.
Note: Implemented Value as a separate generic type (not an alias) for Go 1.20 compatibility.
Deprecated: