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
ConstructorDescriptionSwaggerApiProducer
(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.Swagger
addApiInfo
(io.swagger.models.Swagger swagger) Add common API Info to the descriptor.io.swagger.models.Swagger
Merge 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.Swagger
Mutate the provided descriptor to add the specified path.io.swagger.models.Swagger
withVersion
(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 SwaggerInfo
instance 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 SwaggerInfo
instance 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 SwaggerInfo
instance 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:ApiProducer
Mutate the provided descriptor to add the specified path.- Specified by:
withPath
in 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:ApiProducer
Mutate the provided descriptor to add the specified version.- Specified by:
withVersion
in 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:ApiProducer
Merge the provided descriptors into a single descriptor.- Specified by:
merge
in 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:ApiProducer
Add common API Info to the descriptor.- Specified by:
addApiInfo
in interfaceApiProducer<io.swagger.models.Swagger>
- Parameters:
swagger
- The descriptor.- Returns:
- The modified descriptor.
-
newChildProducer
Description copied from interface:ApiProducer
Create a child producer with the same type, but with the extra ID fragment.- Specified by:
newChildProducer
in interfaceApiProducer<io.swagger.models.Swagger>
- Parameters:
subPath
- The fragment of the ID for this producer.- Returns:
- The new producer.
-