Forum Discussion

Sabhtarsha's avatar
Sabhtarsha
New Contributor
5 years ago
Solved

Generate multiple OAS 3.0 files using the swagger-maven-plugin

Hi,

I have gone through lot of documentation on github and integrated my JaxRS2 based code with the latest 2.1.0 version.

Have extended the Reader for adding custom extension based on my custom annotation appearing along with the @Operation have also tried my hands with adding a ReaderListener to internationalise the texts.

I am now stuck with and curious on how we can split the OAS definition in multiple files?

Like have basic OAS info in a info.yaml/json then paths in paths.yaml/json and components in its own components.yaml/json file and having a base oas file referring all the above sub-files.

The current maven plugin supports generating only single file, is there any way which I may have missed to generate multiple files or this is something to be done as a custom post processing after the single file is generated?

The above splitting is just 1st requirement I intend to take it forward and split the oas file based on versions in the path, with generating files having paths for each version.

  • Hi,

     

    As you mentioned Swagger Core resolves into a single file representing the full spec, and splitting it further has to be done in custom postprocessing. There is no short term plan to add such support (any PRs are more than welcomed)

1 Reply

  • Hi,

     

    As you mentioned Swagger Core resolves into a single file representing the full spec, and splitting it further has to be done in custom postprocessing. There is no short term plan to add such support (any PRs are more than welcomed)