-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Rust: Support Integer enums using Serde_repr #19199
Conversation
modules/openapi-generator/src/main/resources/rust/model.mustache
Outdated
Show resolved
Hide resolved
Agreed, that's much cleaner. Wasnt sure how to remove that, i've updated, synced with master, and re-gen the apis, so hopefully all the workflows should pass now too. |
@@ -59,7 +59,7 @@ interface PetApi { | |||
consumes = ["application/json", "application/xml"] | |||
) | |||
fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity<Pet> { | |||
return getDelegate().addPet(pet, serverHttpRequest) | |||
return getDelegate().addPet(pet, ) |
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.
hmm... why there are changes to kotlin samples?
in the latest msater, the samples are up-to-date. can you please merge the latest master into your branch and regenerate the samples?
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.
Hmm, that's strange, I already did that and merging with master is what caused the kotlin examples to change for me. Perhaps it's an environment thing (I'm using the devcontainers environment and bin/generate-samples.sh
) , or i'll try rollback to an earlier commit where the changes don't happen.
can you please add a test spec for integer enum to |
Ok, I think I've added those tests correctly - just involved updating the yaml file, so that the CI can check that it build correctly right? And dropped those changes to the kotlin files, must be an environment issue on my end |
Thanks a lot for that PR ! |
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming 7.6.0 minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)This #9976 solved this issue but was never merged. This PR incorporated the same changes, and updates it to work with the current version of the app.
closes #9967, closes #18840
An example from my app: The following couldn't be used, because it expected strings as explained in #18840
Now, it generates to integer enums as expected:

First time contributor - LMK if there's anything else I've missed or need to do :)