Skip to content

Configuration Samples

Arthur De Magalhaes edited this page May 31, 2018 · 5 revisions

Vendors must support all the core configurations of this specification. Optionally, they may also support vendor extensions that allow the configuration of framework-specific values for configurations that affect implementation behavior.

The following is a list of configuration values that every vendor must support. For convenience of vendors (and application developers using custom ConfigSources), the full list of supported configuration keys is available as constants in the OASConfig class.

This configuration is used to enable/disable annotation scanning:

mp.openapi.scan.disable=true

This configuration property to specify the list of packages to scan. For example, in this scenario, the bookings package would be scanned:

mp.openapi.scan.packages=org.eclipse.microprofile.openapi.apps.airlines.resources.bookings

This configuration property to specify the list of classes to scan. For example, in this scenario, the ReviewResource class and the AvailabilityResource class would be scanned:

mp.openapi.scan.classes=org.eclipse.microprofile.openapi.apps.airlines.resources.ReviewResource,org.eclipse.microprofile.openapi.apps.airlines.resources.AvailabilityResource

This configuration property to specify the list of packages to ignore from scanning. In this example, all packages but the bookings package will be scanned:

mp.openapi.scan.exclude.packages=org.eclipse.microprofile.openapi.apps.airlines.resources.bookings

This configuration property to specify the list of classes to ignore from scanning. In this example, all classes but the AvailabilityResource and ReviewResource classes will be scanned:

mp.openapi.scan.exclude.classes=org.eclipse.microprofile.openapi.apps.airlines.resources.ReviewResource,org.eclipse.microprofile.openapi.apps.airlines.resources.AvailabilityResource

This configuration property to specify the list of global servers that provide connectivity information:

mp.openapi.servers=https://xyz.com/v1,https://abc.com/v1

Prefix of the configuration property to specify an alternative list of servers to service all operations in a path:

mp.openapi.servers.path./bookings/{id}=https://xyz.io/v1,https://xyz.io/v2

Prefix of the configuration property to specify an alternative list of servers to service an operation. Operations that want to specify an alternative list of servers must define an operationId, a unique string used to identify the operation:

mp.openapi.servers.operation.getBookingById=https://abc.io/v1
Clone this wiki locally