Annotation Type ArraySchema


  • @Target({FIELD,METHOD,PARAMETER,TYPE,ANNOTATION_TYPE})
    @Retention(RUNTIME)
    @Inherited
    public @interface ArraySchema
    The annotation may be used to define a schema of type "array" for a set of elements of the OpenAPI spec, and/or to define additional properties for the schema. It is applicable e.g. to parameters, schema classes (aka "models"), properties of such models, request and response content, header.

    swagger-core resolver and swagger-jaxrs2 reader engine consider this annotation along with JAX-RS annotations, element type and context as input to resolve the annotated element into an OpenAPI schema definition for such element.

    The annotation Schema shall be used for non array elements; ArraySchema and Schema cannot coexist

    See Also:
    Schema (OpenAPI specification), Schema (OpenAPI specification), Schema
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Schema arraySchema
      Allows to define the properties to be resolved into properties of the schema of type `array` (not the ones of the `items` of such schema which are defined in schema.
      Schema contains
      Specifies contains constrictions expressions.
      Extension[] extensions
      The list of optional extensions
      Schema items
      The schemas of the items in the array
      int maxContains
      Provides max contains related to this schema
      int maxItems
      sets the maximum number of items in an array.
      int minContains
      Provides min contains related to this schema
      int minItems
      sets the minimum number of items in an array.
      Schema[] prefixItems
      Provides prefix items to this schema
      Schema schema
      The schema of the items in the array
      Schema unevaluatedItems
      Provides unevaluted items to this schema
      boolean uniqueItems
      determines whether an array of items will be unique
    • Element Detail

      • items

        Schema items
        The schemas of the items in the array
        Returns:
        items
        Since:
        2.2.12
        Default:
        @io.swagger.v3.oas.annotations.media.Schema
      • schema

        Schema schema
        The schema of the items in the array
        Returns:
        schema
        Default:
        @io.swagger.v3.oas.annotations.media.Schema
      • arraySchema

        Schema arraySchema
        Allows to define the properties to be resolved into properties of the schema of type `array` (not the ones of the `items` of such schema which are defined in schema.
        Returns:
        arraySchema
        Since:
        2.0.2
        Default:
        @io.swagger.v3.oas.annotations.media.Schema
      • maxItems

        int maxItems
        sets the maximum number of items in an array. Ignored if value is Integer.MIN_VALUE.
        Returns:
        integer representing maximum number of items in array
        Default:
        -2147483648
      • minItems

        int minItems
        sets the minimum number of items in an array. Ignored if value is Integer.MAX_VALUE.
        Returns:
        integer representing minimum number of items in array
        Default:
        2147483647
      • uniqueItems

        boolean uniqueItems
        determines whether an array of items will be unique
        Returns:
        boolean - whether items in an array are unique or repeating
        Default:
        false
      • extensions

        Extension[] extensions
        The list of optional extensions
        Returns:
        an optional array of extensions
        Default:
        {}
      • contains

        Schema contains
        Specifies contains constrictions expressions.
        Returns:
        contains expression.
        Since:
        2.2.12 / OpenAPI 3.1
        Default:
        @io.swagger.v3.oas.annotations.media.Schema
      • maxContains

        int maxContains
        Provides max contains related to this schema
        Returns:
        max contains
        Since:
        2.2.12 / OpenAPI 3.1
        Default:
        0
      • minContains

        int minContains
        Provides min contains related to this schema
        Returns:
        min contains
        Since:
        2.2.12 / OpenAPI 3.1
        Default:
        0
      • unevaluatedItems

        Schema unevaluatedItems
        Provides unevaluted items to this schema
        Returns:
        unevaluated items
        Since:
        2.2.12 / OpenAPI 3.1
        Default:
        @io.swagger.v3.oas.annotations.media.Schema
      • prefixItems

        Schema[] prefixItems
        Provides prefix items to this schema
        Returns:
        prefixItems
        Since:
        2.2.12 / OpenAPI 3.1
        Default:
        {}