Annotation Interface Items


@Documented @Retention(RUNTIME) public @interface Items
Swagger items annotation.

A limited subset of JSON-Schema's items object.

Used to populate the auto-generated Swagger documentation and UI for server-side @Rest-annotated classes.
Also used to define OpenAPI schema information for POJOs serialized through OpenApiSerializer and parsed through OpenApiParser.

Examples:

// Items have a specific set of enumerated string values @Query( name="status", schema=@Schema( type="array", collectionFormat="csv", items=@Items( type="string", _enum="AVAILABLE,PENDING,SOLD", _default="AVAILABLE" ) ) )

// An array of arrays, the internal array being of type integer, numbers must be between 0 and 63 (inclusive) @Query( name="status", schema=@Schema( type="array", collectionFormat="csv", items=@Items( type="array", items=@SubItems( type="integer", minimum="0", maximum="63" ) ) ) )

See Also:
  • Element Details

    • _default

      default field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      {}
    • description

      Optional description for the exposed API.
      Returns:
      The annotation value.
      Since:
      9.2.0
      Default:
      {}
    • _enum

      enum field of the Swagger Items Object.
      Notes:
      • Each entry is a possible value. Can also contain comma-delimited lists of values.
      Returns:
      The annotation value.
      Default:
      {}
    • $ref

      $ref field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • cf

      Synonym for collectionFormat().
      Returns:
      The annotation value.
      Default:
      ""
    • collectionFormat

      collectionFormat field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • df

      Synonym for _default().
      Returns:
      The annotation value.
      Default:
      {}
    • e

      Synonym for _enum().
      Returns:
      The annotation value.
      Default:
      {}
    • emax

      boolean emax
      Synonym for exclusiveMaximum().
      Returns:
      The annotation value.
      Default:
      false
    • emin

      boolean emin
      Synonym for exclusiveMinimum().
      Returns:
      The annotation value.
      Default:
      false
    • exclusiveMaximum

      exclusiveMaximum field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      false
    • exclusiveMinimum

      exclusiveMinimum field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      false
    • f

      Synonym for format().
      Returns:
      The annotation value.
      Default:
      ""
    • format

      format field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • items

      items field of the Swagger Items Object.

      Describes the type of items in the array.

      Returns:
      The annotation value.
      Default:
      @org.apache.juneau.annotation.SubItems
    • max

      Synonym for maximum().
      Returns:
      The annotation value.
      Default:
      ""
    • maxi

      long maxi
      Synonym for maxItems().
      Returns:
      The annotation value.
      Default:
      -1L
    • maximum

      maximum field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • maxItems

      long maxItems
      maxItems field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      -1L
    • maxl

      long maxl
      Synonym for maxLength().
      Returns:
      The annotation value.
      Default:
      -1L
    • maxLength

      long maxLength
      maxLength field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      -1L
    • min

      Synonym for minimum().
      Returns:
      The annotation value.
      Default:
      ""
    • mini

      long mini
      Synonym for minItems().
      Returns:
      The annotation value.
      Default:
      -1L
    • minimum

      minimum field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • minItems

      long minItems
      minItems field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      -1L
    • minl

      long minl
      Synonym for minLength().
      Returns:
      The annotation value.
      Default:
      -1L
    • minLength

      long minLength
      minLength field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      -1L
    • mo

      Synonym for multipleOf().
      Returns:
      The annotation value.
      Default:
      ""
    • multipleOf

      multipleOf field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • p

      Synonym for pattern().
      Returns:
      The annotation value.
      Default:
      ""
    • pattern

      pattern field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • t

      Synonym for type().
      Returns:
      The annotation value.
      Default:
      ""
    • type

      type field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      ""
    • ui

      boolean ui
      Synonym for uniqueItems().
      Returns:
      The annotation value.
      Default:
      false
    • uniqueItems

      boolean uniqueItems
      uniqueItems field of the Swagger Items Object.
      Notes:
      • The format is a plain-text string.
      Returns:
      The annotation value.
      Default:
      false