openapi-processor-api

License Apache%202.0 blue openapi processor api?label=Maven%20Central

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 the openapi-processor-maven plugin it has to

  • implement the v2.OpenApiProcessor interface

    recommended is to implement v1.OpenApiProcessor to be compatible with previous versions of the gradle/maven plugin (it has the same methods, so it is just a matter of adding the 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/<package>.OpenApiProcessor property file in the resources with the class name of the implementing class for all implemented interfaces (i.e. v2, v1).

  • implement the v2.OpenApiProcessorVersion interface if you want to support the latest release check.

  • implement the v2.OpenApiProcessorTest interface to run integration to with openapi-processor-test (required since 2024.6).

api evolution

api version interface (io.openapiprocessor.api..) supported by gradle plugin supported by maven plugin description

2024.1

..v2.OpenApiProcessor, ..v2.OpenApiProcessorVersion, ..v2.OpenApiProcessorTest

since 2023.2

no API changes, added new Test api

2023.1

..v2.OpenApiProcessor, ..v2.OpenApiProcessorVersion

since 2023.2

no API changes, added new Version api

2021.1

..v1.OpenApiProcessor

since 2021.1

yes

no API changes

2020.3 (1.3.0)

..v1.OpenApiProcessor

yes

yes

no API changes

1.2.0

..v1.OpenApiProcessor

yes

yes

better package name, no other changes

1.1.0

..OpenApiProcessor

yes

yes

new package name

example implementations

For examples see the implementations of

  • SpringService (the entry point of the openapi-processor-spring) implements the api interfaces.

  • and the corresponding services property files in the resources.