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

    Modifier and Type
    Method
    Description
    io.swagger.models.Swagger
    addApiInfo(io.swagger.models.Swagger swagger)
    Add common API Info to the descriptor.
    io.swagger.models.Swagger
    merge(List<io.swagger.models.Swagger> descriptors)
    Merge the provided descriptors into a single descriptor.
    ApiProducer<io.swagger.models.Swagger>
    Create a child producer with the same type, but with the extra ID fragment.
    io.swagger.models.Swagger
    withPath(io.swagger.models.Swagger descriptor, String parentPath)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 Swagger Info 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 Swagger Info 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 Swagger Info 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

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