-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[rust-axum] Fix uint32/uint64 type mapping #23547
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ec51326
fix(rust-axum): fix uint32/uint64 type mapping
LSX-s-Software 841b221
fix(rust-axum): preserve explicit unsigned intent in integer fallback
LSX-s-Software 0a71018
fix(rust-axum): align unsigned handling with RustClient and RustServe…
LSX-s-Software 859f939
fix(rust-axum): enhance schema type handling for unconstrained intege…
LSX-s-Software 39730e7
chore(rust-axum): regenerate samples
LSX-s-Software b62f4c3
test(rust-axum): add `integer-types.yaml` to integration tests
LSX-s-Software 72fbe56
fix(rust-axum): fix malformed Markdown link syntax
LSX-s-Software File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| generatorName: rust-axum | ||
| outputDir: samples/server/petstore/rust-axum/output/rust-axum-integer-types-test | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-axum/integer-types.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/rust-axum | ||
| generateAliasAsModel: true | ||
| additionalProperties: | ||
| hideGenerationTimestamp: "true" | ||
| packageName: rust-axum-integer-types-test | ||
| homePageUrl: https://github.com/openapitools/openapi-generator | ||
| globalProperties: | ||
| skipFormModel: false | ||
| enablePostProcessFile: true |
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
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
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
78 changes: 78 additions & 0 deletions
78
modules/openapi-generator/src/test/resources/3_0/rust-axum/integer-types.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| openapi: 3.0.3 | ||
| info: | ||
| title: Rust Axum Integer Type Mapping Test | ||
| version: 1.0.0 | ||
| paths: | ||
| /integers: | ||
| get: | ||
| operationId: getIntegers | ||
| parameters: | ||
| - name: legacy_uint32 | ||
| in: query | ||
| required: true | ||
| schema: | ||
| type: integer | ||
| format: uint32 | ||
| - name: legacy_uint64 | ||
| in: query | ||
| required: true | ||
| schema: | ||
| type: integer | ||
| format: uint64 | ||
| - name: positive_int32 | ||
| in: query | ||
| required: true | ||
| schema: | ||
| type: integer | ||
| format: int32 | ||
| minimum: 0 | ||
| - name: positive_int64 | ||
| in: query | ||
| required: true | ||
| schema: | ||
| type: integer | ||
| format: int64 | ||
| minimum: 0 | ||
| - name: small_positive | ||
| in: query | ||
| required: true | ||
| schema: | ||
| type: integer | ||
| minimum: 0 | ||
| maximum: 255 | ||
| responses: | ||
| '200': | ||
| description: OK | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/IntegerTypes' | ||
| components: | ||
| schemas: | ||
| IntegerTypes: | ||
| type: object | ||
| required: | ||
| - legacy_uint32 | ||
| - legacy_uint64 | ||
| - positive_int32 | ||
| - positive_int64 | ||
| - small_positive | ||
| properties: | ||
| legacy_uint32: | ||
| type: integer | ||
| format: uint32 | ||
| legacy_uint64: | ||
| type: integer | ||
| format: uint64 | ||
| positive_int32: | ||
| type: integer | ||
| format: int32 | ||
| minimum: 0 | ||
| positive_int64: | ||
| type: integer | ||
| format: int64 | ||
| minimum: 0 | ||
| small_positive: | ||
| type: integer | ||
| minimum: 0 | ||
| maximum: 255 |
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/rust-axum/output/apikey-authorization/.openapi-generator/VERSION
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7.19.0-SNAPSHOT | ||
| 7.22.0-SNAPSHOT |
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
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/rust-axum/output/apikey-auths/.openapi-generator/VERSION
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7.19.0-SNAPSHOT | ||
| 7.22.0-SNAPSHOT |
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
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7.19.0-SNAPSHOT | ||
| 7.22.0-SNAPSHOT |
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
2 changes: 1 addition & 1 deletion
2
samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7.19.0-SNAPSHOT | ||
| 7.22.0-SNAPSHOT |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Explicit unsigned schema intent is no longer considered in integer type resolution, so unconstrained unsigned schemas can regress to signed Rust types.
Prompt for AI agents