Closed
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the generator to preserve the original underlying type for enum values.
- Updates tests to check for the presence of a type definition (status uint8) in various scenarios
- Enhances the Generator struct and parsing logic to capture and validate the original type
- Updates example enum definitions to use uint8 instead of int
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/generator/generator_test.go | Adds test cases to ensure that the type definition is correctly detected |
| internal/generator/generator.go | Introduces an originalType field and updates parsing logic to capture type details |
| _examples/status/status_enum.go | Changes the enum field type from int to uint8 |
| _examples/status/job_status_enum.go | Changes the enum field type from int to uint8 |
Files not reviewed (1)
- internal/generator/enum.go.tmpl: Language not supported
ceda3b9 to
d101189
Compare
d101189 to
dc79835
Compare
Member
|
This feature has been implemented and merged as part of PR #15 (commit 1834756). The generator now preserves the underlying type information (uint8, int32, etc.) in the generated code. The implementation includes:
This PR can now be closed as the feature has been delivered in v0.4.0. |
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.
Preserving the original type for the generated enum value