All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.juneau.annotation.Items Maven / Gradle / Ivy

// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
// * with the License.  You may obtain a copy of the License at                                                              *
// *                                                                                                                         *
// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
// *                                                                                                                         *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
// * specific language governing permissions and limitations under the License.                                              *
// ***************************************************************************************************************************
package org.apache.juneau.annotation;

import static java.lang.annotation.RetentionPolicy.*;

import java.lang.annotation.*;

import org.apache.juneau.oapi.*;

/**
 * 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 {@link OpenApiSerializer} and parsed through {@link 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:
*/ @Documented @Retention(RUNTIME) public @interface Items { /** * default field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String[] _default() default {}; /** * enum field of the Swagger Items Object. * *
Notes:
    *
  • * Each entry is a possible value. Can also contain comma-delimited lists of values. *
* * @return The annotation value. */ String[] _enum() default {}; /** * $ref field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String $ref() default ""; /** * Synonym for {@link #collectionFormat()}. * * @return The annotation value. */ String cf() default ""; /** * collectionFormat field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String collectionFormat() default ""; /** * Synonym for {@link #_default()}. * * @return The annotation value. */ String[] df() default {}; /** * Synonym for {@link #_enum()}. * * @return The annotation value. */ String[] e() default {}; /** * Synonym for {@link #exclusiveMaximum()}. * * @return The annotation value. */ boolean emax() default false; /** * Synonym for {@link #exclusiveMinimum()}. * * @return The annotation value. */ boolean emin() default false; /** * exclusiveMaximum field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ boolean exclusiveMaximum() default false; /** * exclusiveMinimum field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ boolean exclusiveMinimum() default false; /** * Synonym for {@link #format()}. * * @return The annotation value. */ String f() default ""; /** * format field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String format() default ""; /** * items field of the Swagger Items Object. * *

* Describes the type of items in the array. * * @return The annotation value. */ SubItems items() default @SubItems; /** * Synonym for {@link #maximum()}. * * @return The annotation value. */ String max() default ""; /** * Synonym for {@link #maxItems()}. * * @return The annotation value. */ long maxi() default -1; /** * maximum field of the Swagger Items Object. * *

Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String maximum() default ""; /** * maxItems field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ long maxItems() default -1; /** * Synonym for {@link #maxLength()}. * * @return The annotation value. */ long maxl() default -1; /** * maxLength field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ long maxLength() default -1; /** * Synonym for {@link #minimum()}. * * @return The annotation value. */ String min() default ""; /** * Synonym for {@link #minItems()}. * * @return The annotation value. */ long mini() default -1; /** * minimum field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String minimum() default ""; /** * minItems field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ long minItems() default -1; /** * Synonym for {@link #minLength()}. * * @return The annotation value. */ long minl() default -1; /** * minLength field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ long minLength() default -1; /** * Synonym for {@link #multipleOf()}. * * @return The annotation value. */ String mo() default ""; /** * multipleOf field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String multipleOf() default ""; /** * Synonym for {@link #pattern()}. * * @return The annotation value. */ String p() default ""; /** * pattern field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String pattern() default ""; /** * Synonym for {@link #type()}. * * @return The annotation value. */ String t() default ""; /** * type field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ String type() default ""; /** * Synonym for {@link #uniqueItems()}. * * @return The annotation value. */ boolean ui() default false; /** * uniqueItems field of the Swagger Items Object. * *
Notes:
    *
  • * The format is a plain-text string. *
* * @return The annotation value. */ boolean uniqueItems() default false; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy