Package org.forgerock.http.swagger
Class SwaggerApiProducer
- java.lang.Object
-
- org.forgerock.http.swagger.SwaggerApiProducer
-
- All Implemented Interfaces:
ApiProducer<io.swagger.models.Swagger>
public class SwaggerApiProducer extends Object implements ApiProducer<io.swagger.models.Swagger>
An API Producer for APIs that use the Swagger model implementation of the OpenAPI specification.
-
-
Constructor Summary
Constructors Constructor Description SwaggerApiProducer(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.swagger.models.SwaggeraddApiInfo(io.swagger.models.Swagger swagger)Add common API Info to the descriptor.io.swagger.models.Swaggermerge(List<io.swagger.models.Swagger> descriptors)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.SwaggerwithPath(io.swagger.models.Swagger descriptor, String parentPath)Mutate 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 Detail
-
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 Detail
-
withPath
public io.swagger.models.Swagger withPath(io.swagger.models.Swagger descriptor, String parentPath)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
public io.swagger.models.Swagger withVersion(io.swagger.models.Swagger descriptor, Version version)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
public io.swagger.models.Swagger merge(List<io.swagger.models.Swagger> descriptors)
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
public ApiProducer<io.swagger.models.Swagger> newChildProducer(String subPath)
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.
-
-