Hierarchy

  • ResponseBuilder

Constructors

Properties

_mimeType?: string
_response: ResponseObject
_defaults?: ResponseDefaults

Methods

  • Creates a deep copy of the current state of the response and returns it.

    Returns

    A deep copy of the built response object

    Returns ResponseObject

  • Add a content field to the Response object

    Returns

    ResponseBuilder instances for method chaining

    Parameters

    • content: { [media: string]: OpenAPIV3.MediaTypeObject }

      The content object per OpenApiv3 spec

      • [media: string]: OpenAPIV3.MediaTypeObject

    Returns ResponseBuilder

  • Add a header field to the Response object

    Returns

    ResponseBuilder instances for method chaining

    Parameters

    • headers: { [header: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.HeaderObject }

      The header object per OpenApiv3 spec

      • [header: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.HeaderObject

    Returns ResponseBuilder

  • Add a links field to the Response object

    Returns

    ResponseBuilder instances for method chaining

    Parameters

    • links: { [link: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.LinkObject }

      The links object per OpenApiv3 spec

      • [link: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.LinkObject

    Returns ResponseBuilder

  • Add the schema object to the response object. Allows for defining the type of media in place, or inheriting a global default.

    Returns

    ResponseBuilder instances for method chaining

    Throws

    A error if there is no default MIME and a mimeType wasn't included locally

    Parameters

    • schema: ReferenceObject | SchemaObject

      The MediaType object per OpenApiv3 spec

    • Optional mimeType: string

      The string of a valid MIME type

    Returns ResponseBuilder

  • Add the schema object to the response object as an array. Allows for defining the type of media in place, or inheriting a global default.

    Returns

    ResponseBuilder instances for method chaining

    Throws

    A error if there is no default MIME and a mimeType wasn't included locally

    Parameters

    • schema: ReferenceObject | SchemaObject

      The MediaType object per OpenApiv3 spec

    • Optional mimeType: string

      The string of a valid MIME type

    Returns ResponseBuilder

Generated using TypeDoc