Class SecuritySchemeInfo

java.lang.Object
org.apache.juneau.dto.openapi3.OpenApiElement
org.apache.juneau.dto.openapi3.SecuritySchemeInfo

@Bean(properties="in,name,type,description,scheme,bearerFormat,flows,*") public class SecuritySchemeInfo extends OpenApiElement
Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location.

There are five possible parameter types.

  • "path" - Used together with Path Templating, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in /items/{itemId}, the path parameter is itemId.
  • "query" - Parameters that are appended to the URL. For example, in /items?id=###, the query parameter is id.
  • "header" - Custom headers that are expected as part of the request.
  • "body" - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be one body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation.
  • "formData" - Used to describe the payload of an HTTP request when either application/x-www-form-urlencoded, multipart/form-data or both are used as the content type of the request (in Swagger's definition, the consumes property of an operation). This is the only parameter type that can be used to send files, thus supporting the file type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4):
    • "application/x-www-form-urlencoded" - Similar to the format of Query parameters but as a payload. For example, foo=1&bar=swagger - both foo and bar are form parameters. This is normally used for simple parameters that are being transferred.
    • "multipart/form-data" - each parameter takes a section in the payload with an internal header. For example, for the header Content-Disposition: form-data; name="submit-name" the name of the parameter is submit-name. This type of form parameters is more commonly used for file transfers.
Example:

// Construct using SwaggerBuilder. ParameterInfo x = parameterInfo("query", "foo"); // Serialize using JsonSerializer. String json = JsonSerializer.DEFAULT.toString(x); // Or just use toString() which does the same as above. String json = x.toString();

// Output { "in": "query", "name": "foo" }

  • Constructor Details

  • Method Details

    • copy

      Make a deep copy of this object.
      Returns:
      A deep copy of this object.
    • strict

      Description copied from class: OpenApiElement
      Sets strict mode on this bean.
      Overrides:
      strict in class OpenApiElement
      Returns:
      This object
    • getName

      public String getName()
      Bean property getter: name.

      The name of the parameter.

      Notes:
      • Parameter names are case sensitive.
      • If in is "path", the name field MUST correspond to the associated path segment from the path field in the paths object.
      • For all other cases, the name corresponds to the parameter name used based on the in property.
      Returns:
      The property value, or null if it is not set.
    • setName

      Bean property setter: name.

      The name of the parameter.

      Notes:
      • Parameter names are case sensitive.
      • If in is "path", the name field MUST correspond to the associated path segment from the path field in the paths object.
      • For all other cases, the name corresponds to the parameter name used based on the in property.
      Parameters:
      value - The new value for this property.
      Property value is required.
      Returns:
      This object
    • getIn

      public String getIn()
      Bean property getter: in.

      The location of the parameter.

      Returns:
      The property value, or null if it is not set.
    • setIn

      Bean property setter: in.

      The location of the parameter.

      Parameters:
      value - The new value for this property.
      Valid values:
      • "query"
      • "header"
      • "path"
      • "formData"
      • "body"

      Property value is required.
      Returns:
      This object
    • getDescription

      Bean property getter: description.

      A brief description of the parameter.
      This could contain examples of use.

      Returns:
      The property value, or null if it is not set.
    • setDescription

      Bean property setter: description.

      A brief description of the parameter.
      This could contain examples of use.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getScheme

      public String getScheme()
      Bean property getter: schema.

      The schema defining the type used for the body parameter.

      Returns:
      The property value, or null if it is not set.
    • setScheme

      Bean property setter: schema.

      The schema defining the type used for the body parameter.

      Parameters:
      value - The new value for this property.
      Property value is required.
      Returns:
      This object
    • getType

      public String getType()
      Bean property getter: type.

      The type of the parameter.

      Returns:
      The property value, or null if it is not set.
    • setType

      Bean property setter: type.

      The type of the parameter.

      Parameters:
      value - The new value for this property.
      Valid values:
      • "string"
      • "number"
      • "integer"
      • "boolean"
      • "array"
      • "file"

      If type is "file", the consumes MUST be either "multipart/form-data", "application/x-www-form-urlencoded" or both and the parameter MUST be in "formData".
      Property value is required.
      Returns:
      This object
    • getBearerFormat

      Bean property getter: format.

      The extending format for the previously mentioned type.

      Returns:
      The property value, or null if it is not set.
    • setBearerFormat

      Bean property setter: format.

      The extending format for the previously mentioned type.

      Parameters:
      value - The new value for this property.
      Returns:
      This object
    • getFlows

      public OAuthFlow getFlows()
      Bean property getter: items.

      Describes the type of items in the array.

      Returns:
      The property value, or null if it is not set.
    • setFlows

      Bean property setter: items.

      Describes the type of items in the array.

      Parameters:
      value - The new value for this property.
      Property value is required if type is "array".
      Can be null to unset the property.
      Returns:
      This object
    • getOpenIdConnectUrl

      Bean property getter: collectionFormat.

      Determines the format of the array if type array is used.

      Returns:
      The property value, or null if it is not set.
    • setOpenIdConnectUrl

      Bean property setter: collectionFormat.

      Determines the format of the array if type array is used.

      Parameters:
      value - The new value for this property.
      Returns:
      This object
    • get

      public <T> T get(String property, Class<T> type)
      Description copied from class: OpenApiElement
      Generic property getter.

      Can be used to retrieve non-standard Swagger fields such as "$ref".

      Overrides:
      get in class OpenApiElement
      Type Parameters:
      T - The datatype to cast the value to.
      Parameters:
      property - The property name to retrieve.
      type - The datatype to cast the value to.
      Returns:
      The property value, or null if the property does not exist or is not set.
    • set

      public SecuritySchemeInfo set(String property, Object value)
      Description copied from class: OpenApiElement
      Generic property setter.

      Can be used to set non-standard Swagger fields such as "$ref".

      Overrides:
      set in class OpenApiElement
      Parameters:
      property - The property name to set.
      value - The new value for the property.
      Returns:
      This object
    • keySet

      public Set<String> keySet()
      Description copied from class: OpenApiElement
      Returns all the keys on this element.
      Overrides:
      keySet in class OpenApiElement
      Returns:
      All the keys on this element.
      Never null.