OpenAPITools / OpenAPITools/openapi-generator
[REQ][GO] Generating unsigned integers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
Hi everyone,
The Golang generator generates int32 and int64 according to the integer format specified in the OpenAPI spec. Could it be possible to generate unsigned integers when minimum is >= 0?
Consider the following:
schema:
type: integer
example: 16318315
minimum: 1
Could we generate a unit32 for this?
Describe the solution you'd like
Use the minimum constraint to generate unsigned integers.
Describe alternatives you've considered
If we really want unsigned integers, we have to adjust the generated code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Golang generator's handling of OpenAPI integer formats and trace how the minimum constraint is processed. Review the generator's existing tests for integer schemas, then verify that schemas with a nonnegative minimum produce the intended unsigned Go type without changing other integer cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, openapi
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100