kbuntrock / openapi-maven-plugin

Generate openapi documentation for SpringMVC or JaxRS/JakartaRS projects.
https://kbuntrock.github.io/openapi-maven-plugin/
MIT License
13 stars 8 forks source link

Allow setting the title, version and servers through configuration #107

Closed royteeuwen closed 3 months ago

royteeuwen commented 4 months ago

I'm trying to expand the generation of API specs to multiple files, but this does not work correctly. When generating one API spec, you can use the to specify the server urls. But if you would go to multiple API files based on the tag, where you typically want another title + version per file, you would have to redefine the server urls as well every time, because it overrides the entire freeFields of the generic configuration.

To mitigate this, I think it would be nice to have the title, version and servers as minimum to be able to configure as separate configuration fields, instead of using the freeFields

royteeuwen commented 4 months ago

@kbuntrock I have created an initial PR, could you review and see if you agree :)?

kbuntrock commented 4 months ago

Hello @royteeuwen.

I'm scared that this solution will not "scale" well. In the future, someone can come with the same request for another field.

What do you think about a configuration to merge the json in the freeField section instead of a global replacement?

royteeuwen commented 4 months ago

I think the title, version and servers is a real global use case, but merging is the second best alternative for me 😄 better than the current situation

kbuntrock commented 3 months ago

I have pushed some code allowing a merge between the common and specific api configuration. Could you try if it fits your needs?

An example of the configuration can be found in an integration test :

royteeuwen commented 3 months ago

Looks good to me! can you create a release?

kbuntrock commented 3 months ago

Perfect :)

I will release when all on-going bugs and enhancement PRs are merged. In term of planning, it should be mid-february.

kbuntrock commented 3 months ago

Done, will be shipped on 0.0.18