Package org.forgerock.http.swagger
Class SwaggerApiProducer
java.lang.Object
org.forgerock.http.swagger.SwaggerApiProducer
- All Implemented Interfaces:
ApiProducer<io.swagger.models.Swagger>
An API Producer for APIs that use the Swagger model implementation of the OpenAPI specification.
-
Constructor Summary
ConstructorsConstructorDescriptionSwaggerApiProducer(io.swagger.models.Info info) Create a new API Description Producer with null as basePath, host and no scheme.SwaggerApiProducer(io.swagger.models.Info info, String basePath, String host, io.swagger.models.Scheme... schemes) Create a new API Description Producer.SwaggerApiProducer(io.swagger.models.Info info, String basePath, String host, List<io.swagger.models.Scheme> schemes) Create a new API Description Producer. -
Method Summary
Modifier and TypeMethodDescriptionio.swagger.models.SwaggeraddApiInfo(io.swagger.models.Swagger swagger) Add common API Info to the descriptor.io.swagger.models.SwaggerMerge the provided descriptors into a single descriptor.ApiProducer<io.swagger.models.Swagger>newChildProducer(String subPath) Create a child producer with the same type, but with the extra ID fragment.io.swagger.models.SwaggerMutate the provided descriptor to add the specified path.io.swagger.models.SwaggerwithVersion(io.swagger.models.Swagger descriptor, Version version) Mutate the provided descriptor to add the specified version.
-
Constructor Details
-
SwaggerApiProducer
public SwaggerApiProducer(io.swagger.models.Info info) Create a new API Description Producer with null as basePath, host and no scheme.- Parameters:
info- The SwaggerInfoinstance to add to all OpenAPI descriptors.
-
SwaggerApiProducer
public SwaggerApiProducer(io.swagger.models.Info info, String basePath, String host, io.swagger.models.Scheme... schemes) Create a new API Description Producer.- Parameters:
info- The SwaggerInfoinstance to add to all OpenAPI descriptors.basePath- The base path.host- The host, if known at construction time, otherwise null.schemes- The supported schemes.
-
SwaggerApiProducer
public SwaggerApiProducer(io.swagger.models.Info info, String basePath, String host, List<io.swagger.models.Scheme> schemes) Create a new API Description Producer.- Parameters:
info- The SwaggerInfoinstance to add to all OpenAPI descriptors.basePath- The base path.host- The host, if known at construction time, otherwise null.schemes- The supported schemes.
-
-
Method Details
-
withPath
Description copied from interface:ApiProducerMutate the provided descriptor to add the specified path.- Specified by:
withPathin interfaceApiProducer<io.swagger.models.Swagger>- Parameters:
descriptor- The descriptor to be mutated.parentPath- The path to add to the descriptor.- Returns:
- The new descriptor.
-
withVersion
Description copied from interface:ApiProducerMutate the provided descriptor to add the specified version.- Specified by:
withVersionin interfaceApiProducer<io.swagger.models.Swagger>- Parameters:
descriptor- The descriptor to be mutated.version- The version to apply to the resource.- Returns:
- The new descriptor.
-
merge
Description copied from interface:ApiProducerMerge the provided descriptors into a single descriptor.- Specified by:
mergein interfaceApiProducer<io.swagger.models.Swagger>- Parameters:
descriptors- The descriptors to be merged.- Returns:
- The merged descriptor.
-
addApiInfo
public io.swagger.models.Swagger addApiInfo(io.swagger.models.Swagger swagger) Description copied from interface:ApiProducerAdd common API Info to the descriptor.- Specified by:
addApiInfoin interfaceApiProducer<io.swagger.models.Swagger>- Parameters:
swagger- The descriptor.- Returns:
- The modified descriptor.
-
newChildProducer
Description copied from interface:ApiProducerCreate a child producer with the same type, but with the extra ID fragment.- Specified by:
newChildProducerin interfaceApiProducer<io.swagger.models.Swagger>- Parameters:
subPath- The fragment of the ID for this producer.- Returns:
- The new producer.
-