swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

Extensions example

Open sougiovn opened this issue 4 years ago • 0 comments

As said in the extension section from the README

This project has a core artifact--swagger-parser, which uses Java Service Provider Inteface (SPI) so additional extensions can be added.

To build your own extension, you simply need to create a src/main/resources/META-INF/services/io.swagger.parser.SwaggerParserExtension file with the full classname of your implementation. Your class must also implement the io.swagger.parser.SwaggerParserExtension interface. Then, including your library with the swagger-parser module will cause it to be triggered automatically.

I've never worked with SPI before, even searching about it I couldn't make it work with swagger-parser.

Could you provide an example on how to add a custom extension parser?

sougiovn avatar Mar 05 '21 02:03 sougiovn