-
Notifications
You must be signed in to change notification settings - Fork 877
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
Add OPEN API / DTO generation #52
Add OPEN API / DTO generation #52
Conversation
What are the benefits of moving from springfox to springdoc? |
Hello @arey I didn't get you main idea behind this issue. |
Hello @arey |
Hi @alexandre-touret Do you think we could keep the same contract? We have several petclinic forks (ie the Angular one) that are based upon. |
I do the same in my company. |
Add minimal mapstruct configuration BREAKING CHANGE: the springdoc dependency is incompatible with this plugin. I rollbacked to springfox/swagger
Hello @arey If I understood, your date format is The openapi generator does't add any JsonFormat annotation. When I try to run the existing unit tests I always have a serialization issue because this date pattern is not clearly recognized. Currently it works because you previously used this annotation. My question is : is it possible to change the date format to |
In the |
Hello, |
…ne with Pets BREAKING CHANGE: the date format is now yyyy-MM-dd instead of yyyy/MM/dd
@alexandre-touret as I recall, springfox also doesn't support this date format |
UPD. |
In the real world, providing a v2 version with dual run will be the solution. But for a sample it's too much work. Maybe just changing the API path to |
Hello, There are an infinite recursion with the generated classes. If I fixed this issue, I would modify the DTOs and add another backward regression I then have a "simple" question : does it worth? Regards |
Hi Alexandre, Sorry for the delay. By bidirectionnal relationship, did you mean the reference of the
Personally, I don't think it's helpful. An acyclic graph is often preferable. |
Hi, When I mentionned bidirectionall relationship, I meant this kind of error produced by the
When I asked you for knowing if it is workth, I would like to know if this whole functionality worths breaking the backward compatibility. IMO, it doesn't worth. |
In order to get closer to the standards, I think you can go on. We may add a changelog to the readme. And I'm sure that @simrin051 or me could migrate the Spring Petclinic Angular fork. Does your OpenAPI specs looks like the one petclinic.openapi.yaml coded by @freemanjp ? |
I generated the openapi description file from the current REST API. |
The generated file seems to require some little rework.
Same remark for the visit date. In the given yaml, the editable fields are factorized in a
I don't know if it's a good practice or not. |
src/main/java/org/springframework/samples/petclinic/rest/OwnerRestController.java
Show resolved
Hide resolved
Currently fixing Visit unit tests
Add minimal mapstruct configuration BREAKING CHANGE: the springdoc dependency is incompatible with this plugin. I rollbacked to springfox/swagger
…ne with Pets BREAKING CHANGE: the date format is now yyyy-MM-dd instead of yyyy/MM/dd
Currently fixing Visit unit tests
Hi @arey , |
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.
Good job Alexandre
added package-lock.json
Purpose
Closes #35
How is it done?
Using Open Api Generator in the build phase using maven.
The file api-docs.yml is processed during the build phase by this plugin and then generates the source files in the
target/generated-sources/openapi
folder.The mapping with the entities is made by mapstruct.
Validation
All the unit & integration tests have been successfully executed .