Merged
Conversation
fix: add missing newline at end of generated file & reorder fields
f358a8c to
c008c15
Compare
Contributor
|
Looks fine, but you are missing the application of this in |
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
|
You are not using the |
fix: test fix: linter
2fa8b8a to
2b21387
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the new enum directive, enabling enum values to be specified and applied to schema properties.
- Introduces a new enumerable interface and associated applyEnums function in gen.go and updates the customizer.
- Updates test files to include enum declarations and adds generated output for enums in templates.
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| gen_test.go | Added a new test method for enums |
| gen.go | Introduced enumerable interface and applyEnums function |
| cmd/oapi-gen/testdata/test.go | Added enum directive comment for testing |
| cmd/oapi-gen/testdata/all.go | Extended test object with enum values |
| cmd/oapi-gen/gen.go | Implemented parsing and template generation support for enum directives |
Files not reviewed (2)
- testdata/spec-pkgseg0.json: Language not supported
- testdata/spec.json: Language not supported
Nicholas Wiersma (nrwiersma)
approved these changes
May 5, 2025
Contributor
Nicholas Wiersma (nrwiersma)
left a comment
There was a problem hiding this comment.
Minor nitpick.
Co-authored-by: Nicholas Wiersma <nick@wiersma.co.za>
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.
Goal of this PR
Fixes #16
This PR adds support for the
enumdirective.How did I test it?
Updated the unit tests.