-
Notifications
You must be signed in to change notification settings - Fork 86
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
Added feature to set schema mappings when generation clients. #846
base: main
Are you sure you want to change the base?
Added feature to set schema mappings when generation clients. #846
Conversation
Strange that the build failed, it (as usual) worked when I tried it with |
@denvitaharen take a look at https://github.com/quarkiverse/quarkus-openapi-generator/blob/main/CONTRIBUTING.md#resteasy-reactive-and-resteasy-classic for testing RESTEasy Reactive locally. |
Sorry, my bad! I didn't noticed the different profiles, probably to tired to understand :) I have updated the test, rerun the test suite and it works now. |
I updated the definition of YearMonth in the OpenAPI yaml. It was incorrect, it represented an LocalDateTime instead of an YearMonth. It doesn't change anything in the functionality, it's more about having a correct OpenAPI specification. Thanks to my colleague @sajox that saw the error. |
docs/modules/ROOT/pages/client.adoc
Outdated
If you have an object you want to map to an datatype, you can use the schema mappings. For instance, if your schema is based | ||
on `java.Time.YearMonth`, it will be mapped to an string when generating. If you want to convert the object `YearMonth`then | ||
you can use the following settings: |
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.
If you have an object you want to map to an datatype, you can use the schema mappings. For instance, if your schema is based | |
on `java.Time.YearMonth`, it will be mapped to an string when generating. If you want to convert the object `YearMonth`then | |
you can use the following settings: | |
If you have an object you want to map to a datatype, you can use the schema mappings. For instance, if your schema is based on `java.Time.YearMonth`, it will be mapped to a string when generating. If you want to convert the object `YearMonth,` then you can use the following settings: |
Can you please rephrase this paragraph? I'm not sure if I understood what you meant here.
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 feedback and I understand what you mean, I also had problems understanding want I meant. I tried to rephrase the paragraph but I was never happy about it, but when I read the whole section one more time, I felt that it was enough with an example and description on how to use it (in the table) and then an link to the documentation on OpenAPI page instead.
It felt more right and easier to understand.
If you feel that this is not the way to go then I will happily try to write an new text :)
When we tried to migrate from specifying our own openapi generator in Maven to Quarkus OpenAPI generator we realized that we missed the possibility two specify schema mappings: https://openapi-generator.tech/docs/customization/#schema-mapping
Its possible to specify that in the OpenAPI generator, so it was just to expose it so you can set it in the application.properties.
Updated the type mapping test and updated the documentation, hopefully I did all I supposed to do, this is my first attempt to help in an public repo :)