Skip to content

Preserve original value type #9

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codemageddon
Copy link
Contributor

Preserving the original type for the generated enum value

@codemageddon codemageddon requested a review from umputun as a code owner March 31, 2025 21:42
@umputun umputun requested a review from Copilot April 1, 2025 02:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@codemageddon codemageddon force-pushed the preserve-original-value-type branch from ceda3b9 to d101189 Compare April 1, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant