-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[Rust-Axum][Breaking Change] Improve the oneOf
model generator
#20336
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
wing328
merged 13 commits into
OpenAPITools:master
from
Victoria-Casasampere-BeeTheData:rust-axum-oneOf-enum
Jan 8, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b185c32
Improve the implementation of oneOf
Victoria-Casasampere-BeeTheData 1785178
Fixed 2.0 schemas; possible freeze present
Victoria-Casasampere-BeeTheData e82cf54
Fix generate-samples.sh freezing
Victoria-Casasampere-BeeTheData 8732843
Fix validation of primitive types
Victoria-Casasampere-BeeTheData e5d74de
Move oneOf handling to its own method
Victoria-Casasampere-BeeTheData 9c665e0
Fix formatting and add comments
Victoria-Casasampere-BeeTheData 6ade255
Remove allOf based discriminator handling
Victoria-Casasampere-BeeTheData ab259fa
Implement a test for v3 oneOf
Victoria-Casasampere-BeeTheData 42b2b4a
Implement oneOf tests for rust axum
Victoria-Casasampere-BeeTheData 6e5ea62
Fix circle CI
Victoria-Casasampere-BeeTheData 293bdbc
Fix pom path, ensure cargo is present
Victoria-Casasampere-BeeTheData 7bfe55d
Implement untagged test
Victoria-Casasampere-BeeTheData 7982cd8
Add final and fix double underscore typo
Victoria-Casasampere-BeeTheData 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
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,11 @@ | ||
generatorName: rust-axum | ||
outputDir: samples/server/petstore/rust-axum/output/rust-axum-oneof | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-oneof.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/rust-axum | ||
generateAliasAsModel: true | ||
additionalProperties: | ||
hideGenerationTimestamp: "true" | ||
packageName: rust-axum-oneof | ||
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
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 |
---|---|---|
|
@@ -28,3 +28,6 @@ pub mod apis; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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
9 changes: 9 additions & 0 deletions
9
modules/openapi-generator/src/main/resources/rust-axum/tests.mustache
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,9 @@ | ||
#[test] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add tests in another PR |
||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
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.
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.
This was annoying to me, it broke string formatting, which made debugging slightly harder.
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.
👌
thanks for the fix.
cc @OpenAPITools/generator-core-team