openapi-processor-api

License Apache%202.0 blue

This library provides a simple api for an openapi-processor-* library. By implementing this api it will automatically work with the openapi-processor gradle plugin or the maven plugin.

implementing the api

To make an openapi-processor available to the openapi-processor-gradle plugin or or the openapi-processor-maven plugin it has to

  • implement the v1.OpenApiProcessor interface.

    the plugins use the name provided by String getName(); to configure the processor and to provide the task to run it.

    the plugins will call void run(Map<String, ?> options); to run the processor, passing all extra settings in the options map with the property setting name as the key.

  • provide a META-INF/services/io.openapiprocessor.api.OpenApiProcessor property file in the resources with the class name of the implementing class.

api evolution

api version interface supported by gradle plugin supported by maven plugin description

2021.1

io.openapiprocessor.api.v1.OpenApiProcessor

since 2021.1

no (all processors still use the 1.0.0 API)

no API changes

2020.3 (1.3.0)

io.openapiprocessor.api.v1.OpenApiProcessor

yes

no

no API changes

1.2.0

io.openapiprocessor.api.v1.OpenApiProcessor

yes

no

better package name, no other changes

1.1.0

io.openapiprocessor.api.OpenApiProcessor

yes

no

new package name

1.0.0

com.github.hauner.openapi.api.OpenApiProcessor

yes

yes

old package name, still used by all processors

example implementations

the examples follow the above instructions but use the original interface with a different package name.

For examples see the implementations of

  • JsonProcessor (the entry point of the openapi-processor-json) implements the api interface

  • and the corresponding services property file in the resources.