blob: c0b75ee939991ce65f893dac970ddff39abc2755 [file] [log] [blame]
// ***************************************************************************************************************************
// * 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.http.annotation;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import java.util.*;
import org.apache.juneau.jsonschema.annotation.Items;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.httppart.*;
import org.apache.juneau.json.*;
import org.apache.juneau.jsonschema.*;
import org.apache.juneau.oapi.*;
/**
* REST request path annotation.
*
* <p>
* Identifies a POJO to be used as a path entry on an HTTP request.
*
* <p>
* Can be used in the following locations:
* <ul>
* <li>Arguments and argument-types of server-side <ja>@RestMethod</ja>-annotated methods.
* <li>Arguments and argument-types of client-side <ja>@RemoteResource</ja>-annotated interfaces.
* <li>Methods and return types of server-side and client-side <ja>@Request</ja>-annotated interfaces.
* </ul>
*
* <h5 class='topic'>Arguments and argument-types of server-side @RestMethod-annotated methods</h5>
*
* Annotation that can be applied to a parameter of a <ja>@RestMethod</ja>-annotated method to identify it as a variable
* in a URL path pattern.
*
* <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
* <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/myurl/{foo}/{bar}/{baz}/*"</js>)
* <jk>public void</jk> doGet(
* <ja>@Path</ja>(<js>"foo"</js>) String foo,
* <ja>@Path</ja>(<js>"bar"</js>) <jk>int</jk> bar,
* <ja>@Path</ja>(<js>"baz"</js>) UUID baz,
* <ja>@Path</ja>(<js>"/*"</js>) String remainder,
* ) {...}
* </p>
*
* <p>
* The special name <js>"/*"</js> is used to retrieve the path remainder after the path match (i.e. the part that matches <js>"/*"</js>).
*
* <ul class='seealso'>
* <li class='link'>{@doc juneau-rest-server.HttpPartAnnotations.Path}
* <li class='link'>{@doc juneau-rest-server.Swagger}
* <li class='extlink'>{@doc SwaggerParameterObject}
* </ul>
*
* <h5 class='topic'>Arguments and argument-types of client-side @RemoteResource-annotated interfaces</h5>
*
* Annotation applied to Java method arguments of interface proxies to denote that they are path variables on the request.
*
* <ul class='seealso'>
* <li class='link'>{@doc juneau-rest-client.RestProxies.Path}
* </ul>
*
* <h5 class='topic'>Methods and return types of server-side and client-side @Request-annotated interfaces</h5>
*
* <ul class='seealso'>
* <li class='link'>{@doc juneau-rest-server.HttpPartAnnotations.Request}
* <li class='link'>{@doc juneau-rest-client.RestProxies.Request}
* </ul>
*/
@Documented
@Target({PARAMETER,FIELD,METHOD,TYPE})
@Retention(RUNTIME)
@Inherited
public @interface Path {
/**
* Specifies the {@link HttpPartSerializer} class used for serializing values to strings.
*
* <p>
* Overrides for this part the part serializer defined on the REST client which by default is {@link OpenApiSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default HttpPartSerializer.Null.class;
/**
* Specifies the {@link HttpPartParser} class used for parsing strings to values.
*
* <p>
* Overrides for this part the part parser defined on the REST resource which by default is {@link OpenApiParser}.
*/
Class<? extends HttpPartParser> parser() default HttpPartParser.Null.class;
//=================================================================================================================
// Attributes common to all Swagger Parameter objects
//=================================================================================================================
/**
* URL path variable name.
*
* <p>
* The path remainder after the path match can be referenced using the name <js>"/*"</js>.
* <br>The non-URL-decoded path remainder after the path match can be referenced using the name <js>"/**"</js>.
*
* <p>
* The value should be either a valid path parameter name, or <js>"*"</js> to represent multiple name/value pairs
*
* <p>
* A blank value (the default) has the following behavior:
* <ul class='spaced-list'>
* <li>
* If the data type is <c>NameValuePairs</c>, <c>Map</c>, or a bean,
* then it's the equivalent to <js>"*"</js> which will cause the value to be treated as name/value pairs.
*
* <h5 class='figure'>Examples:</h5>
* <p class='bcode w800'>
* <jc>// When used on a REST method</jc>
* <ja>@RestMethod</ja>(path=<js>"/addPet"</js>)
* <jk>public void</jk> addPet(<ja>@Path</ja> ObjectMap allPathParameters) {...}
* </p>
* <p class='bcode w800'>
* <jc>// When used on a remote method parameter</jc>
* <ja>@RemoteResource</ja>(path=<js>"/myproxy"</js>)
* <jk>public interface</jk> MyProxy {
*
* <jc>// Equivalent to @Path("*")</jc>
* <ja>@RemoteMethod</ja>(path=<js>"/mymethod/{foo}/{bar}"</js>)
* String myProxyMethod1(<ja>@Path</ja> Map&lt;String,Object&gt; allPathParameters);
* }
* </p>
* <p class='bcode w800'>
* <jc>// When used on a request bean method</jc>
* <jk>public interface</jk> MyRequest {
*
* <jc>// Equivalent to @Path("*")</jc>
* <ja>@Path</ja>
* Map&lt;String,Object&gt; getPathVars();
* }
* </p>
* </li>
* <li>
* If used on a request bean method, uses the bean property name.
*
* <h5 class='figure'>Example:</h5>
* <p class='bcode w800'>
* <jk>public interface</jk> MyRequest {
*
* <jc>// Equivalent to @Path("foo")</jc>
* <ja>@Path</ja>
* String getFoo();
* }
* </ul>
*
* <p>
* The name field MUST correspond to the associated {@doc SwaggerPathsPath path} segment from the path field in the {@doc SwaggerPathsObject Paths Object}.
* See {@doc SwaggerPathTemplating Path Templating} for further information.
*
* <ul class='notes'>
* <li>
* The format is plain-text.
* </ul>
*/
String name() default "";
/**
* A synonym for {@link #name()}.
*
* <p>
* Allows you to use shortened notation if you're only specifying the name.
*
* <p>
* The following are completely equivalent ways of defining a path entry:
* <p class='bcode w800'>
* <ja>@RestMethod</ja>(
* name=<js>"GET"</js>,
* path=<js>"/pet/{petId}"</js>
* )
* <jk>public</jk> Pet getPet(<ja>@Path</ja>(name=<js>"petId"</js>) <jk>long</jk> petId) { ... }
* </p>
* <p class='bcode w800'>
* <ja>@RestMethod</ja>(
* name=<js>"GET"</js>,
* path=<js>"/pet/{petId}"</js>
* )
* <jk>public</jk> Pet getPet(<ja>@Path</ja>(<js>"petId"</js>) <jk>long</jk> petId) { ... }
* </p>
*/
String value() default "";
/**
* <mk>description</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* A brief description of the parameter. This could contain examples of use.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side generated Swagger documentation.
* </ul>
*
* <ul class='notes'>
* <li>
* The format is plain text.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports {@doc DefaultRestSvlVariables}
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
String[] description() default {};
//=================================================================================================================
// Attributes specific to parameters other than body
//=================================================================================================================
/**
* <mk>type</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* The type of the parameter.
*
* <p>
* The possible values are:
* <ul class='spaced-list'>
* <li>
* <js>"string"</js>
* <br>Parameter must be a string or a POJO convertible from a string.
* <li>
* <js>"number"</js>
* <br>Parameter must be a number primitive or number object.
* <br>If parameter is <c>Object</c>, creates either a <c>Float</c> or <c>Double</c> depending on the size of the number.
* <li>
* <js>"integer"</js>
* <br>Parameter must be a integer/long primitive or integer/long object.
* <br>If parameter is <c>Object</c>, creates either a <c>Short</c>, <c>Integer</c>, or <c>Long</c> depending on the size of the number.
* <li>
* <js>"boolean"</js>
* <br>Parameter must be a boolean primitive or object.
* <li>
* <js>"array"</js>
* <br>Parameter must be an array or collection.
* <br>Elements must be strings or POJOs convertible from strings.
* <br>If parameter is <c>Object</c>, creates an {@link ObjectList}.
* <li>
* <js>"object"</js>
* <br>Parameter must be a map or bean.
* <br>If parameter is <c>Object</c>, creates an {@link ObjectMap}.
* <br>Note that this is an extension of the OpenAPI schema as Juneau allows for arbitrarily-complex POJOs to be serialized as HTTP parts.
* <li>
* <js>"file"</js>
* <br>This type is currently not supported.
* </ul>
*
* <p>
* Static strings are defined in {@link ParameterType}.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing.
* </ul>
*
* <ul class='seealso'>
* <li class='extlink'>{@doc SwaggerDataTypes}
* </ul>
*/
String type() default "";
/**
* <mk>format</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* The extending format for the previously mentioned {@doc SwaggerParameterTypes parameter type}.
*
* <p>
* The possible values are:
* <ul class='spaced-list'>
* <li>
* <js>"int32"</js> - Signed 32 bits.
* <br>Only valid with type <js>"integer"</js>.
* <li>
* <js>"int64"</js> - Signed 64 bits.
* <br>Only valid with type <js>"integer"</js>.
* <li>
* <js>"float"</js> - 32-bit floating point number.
* <br>Only valid with type <js>"number"</js>.
* <li>
* <js>"double"</js> - 64-bit floating point number.
* <br>Only valid with type <js>"number"</js>.
* <li>
* <js>"byte"</js> - BASE-64 encoded characters.
* <br>Only valid with type <js>"string"</js>.
* <br>Parameters of type POJO convertible from string are converted after the string has been decoded.
* <li>
* <js>"binary"</js> - Hexadecimal encoded octets (e.g. <js>"00FF"</js>).
* <br>Only valid with type <js>"string"</js>.
* <br>Parameters of type POJO convertible from string are converted after the string has been decoded.
* <li>
* <js>"date"</js> - An <a href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339 full-date</a>.
* <br>Only valid with type <js>"string"</js>.
* <li>
* <js>"date-time"</js> - An <a href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339 date-time</a>.
* <br>Only valid with type <js>"string"</js>.
* <li>
* <js>"password"</js> - Used to hint UIs the input needs to be obscured.
* <br>This format does not affect the serialization or parsing of the parameter.
* <li>
* <js>"uon"</js> - UON notation (e.g. <js>"(foo=bar,baz=@(qux,123))"</js>).
* <br>Only valid with type <js>"object"</js>.
* <br>If not specified, then the input is interpreted as plain-text and is converted to a POJO directly.
* </ul>
*
* <p>
* Static strings are defined in {@link FormatType}.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing.
* </ul>
*
* <ul class='seealso'>
* <li class='extlink'>{@doc SwaggerDataTypeFormats}
* </ul>
*/
String format() default "";
/**
* <mk>allowEmptyValue</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Sets the ability to pass empty-valued path parameter values.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*
* <p>
* <b>Note:</b> This is technically only valid for either query or formData parameters, but support is provided anyway for backwards compatability.
*/
boolean allowEmptyValue() default false;
/**
* <mk>items</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Describes the type of items in the array.
* <p>
* Required if <c>type</c> is <js>"array"</js>.
* <br>Can only be used if <c>type</c> is <js>"array"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing and parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing and serializing validation.
* </ul>
*/
Items items() default @Items;
/**
* <mk>collectionFormat</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Determines the format of the array if <c>type</c> <js>"array"</js> is used.
* <br>Can only be used if <c>type</c> is <js>"array"</js>.
*
* <br>Possible values are:
* <ul class='spaced-list'>
* <li>
* <js>"csv"</js> (default) - Comma-separated values (e.g. <js>"foo,bar"</js>).
* <li>
* <js>"ssv"</js> - Space-separated values (e.g. <js>"foo bar"</js>).
* <li>
* <js>"tsv"</js> - Tab-separated values (e.g. <js>"foo\tbar"</js>).
* <li>
* <js>"pipes</js> - Pipe-separated values (e.g. <js>"foo|bar"</js>).
* <li>
* <js>"uon"</js> - UON notation (e.g. <js>"@(foo,bar)"</js>).
* <li>
* </ul>
*
* <p>
* Static strings are defined in {@link CollectionFormatType}.
*
* <p>
* Note that for collections/arrays parameters with POJO element types, the input is broken into a string array before being converted into POJO elements.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing.
* </ul>
*/
String collectionFormat() default "";
/**
* <mk>maximum</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Defines the maximum value for a parameter of numeric types.
* <br>The value must be a valid JSON number.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
String maximum() default "";
/**
* <mk>exclusiveMaximum</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Defines whether the maximum is matched exclusively.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <c>maximum</c>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
boolean exclusiveMaximum() default false;
/**
* <mk>minimum</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Defines the minimum value for a parameter of numeric types.
* <br>The value must be a valid JSON number.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
String minimum() default "";
/**
* <mk>exclusiveMinimum</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* Defines whether the minimum is matched exclusively.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
* <br>If <jk>true</jk>, Must be accompanied with <c>minimum</c>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
boolean exclusiveMinimum() default false;
/**
* <mk>maxLength</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
* <br>The length of a string instance is defined as the number of its characters as defined by <a href='https://tools.ietf.org/html/rfc4627'>RFC 4627</a>.
* <br>The value <c>-1</c> is always ignored.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
long maxLength() default -1;
/**
* <mk>minLength</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
* <br>The length of a string instance is defined as the number of its characters as defined by <a href='https://tools.ietf.org/html/rfc4627'>RFC 4627</a>.
* <br>The value <c>-1</c> is always ignored.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
long minLength() default -1;
/**
* <mk>pattern</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* A string input is valid if it matches the specified regular expression pattern.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
String pattern() default "";
/**
* <mk>maxItems</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* An array or collection is valid if its size is less than, or equal to, the value of this keyword.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
long maxItems() default -1;
/**
* <mk>minItems</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* An array or collection is valid if its size is greater than, or equal to, the value of this keyword.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
long minItems() default -1;
/**
* <mk>uniqueItems</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* If <jk>true</jk> the input validates successfully if all of its elements are unique.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* If the parameter type is a subclass of {@link Set}, this validation is skipped (since a set can only contain unique items anyway).
* <br>Otherwise, the collection or array is checked for duplicate items.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
boolean uniqueItems() default false;
/**
* <mk>enum</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* If specified, the input validates successfully if it is equal to one of the elements in this array.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* The format is a {@doc juneau-marshall.JsonDetails.SimplifiedJson} array or comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
*
* <h5 class='section'>Examples:</h5>
* <p class='bcode w800'>
* <jc>// Comma-delimited list</jc>
* <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/pet/findByStatus/{status}"</js>)
* <jk>public</jk> Collection&lt;Pet&gt; findPetsByStatus(
* <ja>@Path</ja>(
* name=<js>"status"</js>,
* _enum=<js>"AVAILABLE,PENDING,SOLD"</js>,
* ) PetStatus status
* ) {...}
* </p>
* <p class='bcode w800'>
* <jc>// JSON array</jc>
* <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/pet/findByStatus/{status}"</js>)
* <jk>public</jk> Collection&lt;Pet&gt; findPetsByStatus(
* <ja>@Path</ja>(
* name=<js>"status"</js>,
* _enum=<js>"['AVAILABLE','PENDING','SOLD']"</js>,
* ) PetStatus status
* ) {...}
* </p>
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
String[] _enum() default {};
/**
* <mk>multipleOf</mk> field of the {@doc SwaggerParameterObject}.
*
* <p>
* A numeric instance is valid if the result of the division of the instance by this keyword's value is an integer.
* <br>The value must be a valid JSON number.
*
* <p>
* If validation fails during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>On the client-side, this gets converted to a <c>RestCallException</c> which is thrown before the connection is made.
* <br>On the server-side, this gets converted to a <c>BadRequest</c> (400).
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side schema-based parsing validation.
* <li>
* Server-side generated Swagger documentation.
* <li>
* Client-side schema-based serializing validation.
* </ul>
*/
String multipleOf() default "";
//=================================================================================================================
// Other
//=================================================================================================================
/**
* A serialized example of the parameter.
*
* <p>
* This attribute defines a representation of the value that is used by <c>BasicRestInfoProvider</c> to construct
* an example of parameter.
*
* <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
* <ja>@Path</ja>(
* name=<js>"status"</js>,
* type=<js>"array"</js>,
* collectionFormat=<js>"csv"</js>,
* example=<js>"AVALIABLE,PENDING"</js>
* )
* PetStatus[] status
* </p>
*
* <p>
* If not specified, Juneau will automatically create examples from sample POJOs serialized using the registered {@link HttpPartSerializer}.
* <br>
*
* </p>
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side generated Swagger documentation.
* </ul>
*
* <ul class='seealso'>
* <li class='ja'>{@link Example}
* <li class='jc'>{@link BeanContext}
* <ul>
* <li class='jf'>{@link BeanContext#BEAN_examples BEAN_examples}
* </ul>
* <li class='jc'>{@link JsonSchemaSerializer}
* <ul>
* <li class='jf'>{@link JsonSchemaGenerator#JSONSCHEMA_addExamplesTo JSONSCHEMA_addExamplesTo}
* <li class='jf'>{@link JsonSchemaGenerator#JSONSCHEMA_allowNestedExamples JSONSCHEMA_allowNestedExamples}
* </ul>
* </ul>
*
* <ul class='notes'>
* <li>
* The format is a {@doc juneau-marshall.JsonDetails.SimplifiedJson} object or plain text string.
* <br>Multiple lines are concatenated with newlines.
* <li>
* Supports {@doc DefaultRestSvlVariables}
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
String[] example() default {};
/**
* Free-form value for the {@doc SwaggerParameterObject}.
*
* <p>
* This is a {@doc juneau-marshall.JsonDetails.SimplifiedJson} object that makes up the swagger information for this field.
*
* <p>
* The following are completely equivalent ways of defining the swagger description of the Path object:
* <p class='bcode w800'>
* <jc>// Normal</jc>
* <ja>@Path</ja>(
* name=<js>"orderId"</js>,
* description=<js>"ID of order to fetch"</js>,
* maximum=<js>"1000"</js>,
* minimum=<js>"101"</js>,
* example=<js>"123"</js>
* )
* </p>
* <p class='bcode w800'>
* <jc>// Free-form</jc>
* <ja>@Path</ja>({
* name=<js>"orderId"</js>,
* api={
* <js>"description: 'ID of order to fetch',"</js>,
* <js>"maximum: 1000,"</js>,
* <js>"minimum: 101,"</js>,
* <js>"example: 123"</js>
* }
* )
* </p>
* <p class='bcode w800'>
* <jc>// Free-form using variables</jc>
* <ja>@Path</ja>({
* name=<js>"orderId"</js>,
* api=<js>"$L{orderIdSwagger}"</js>
* )
* </p>
* <p class='bcode w800'>
* <mc>// Contents of MyResource.properties</mc>
* <mk>orderIdSwagger</mk> = <mv>{ description: "ID of order to fetch", maximum: 1000, minimum: 101, example: 123 }</mv>
* </p>
*
* <p>
* The reasons why you may want to use this field include:
* <ul>
* <li>You want to pull in the entire Swagger JSON definition for this field from an external source such as a properties file.
* <li>You want to add extra fields to the Swagger documentation that are not officially part of the Swagger specification.
* </ul>
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
* Server-side generated Swagger documentation.
* </ul>
*
* <ul class='notes'>
* <li>
* Note that the only swagger field you can't specify using this value is <js>"name"</js> whose value needs to be known during servlet initialization.
* <li>
* The format is a {@doc juneau-marshall.JsonDetails.SimplifiedJson} object.
* <li>
* Automatic validation is NOT performed on input based on attributes in this value.
* <li>
* The leading/trailing <c>{ }</c> characters are optional.
* <br>The following two example are considered equivalent:
* <p class='bcode w800'>
* <ja>@Path</ja>(api=<js>"{description: 'ID of order to fetch'}"</js>)
* </p>
* <p class='bcode w800'>
* <ja>@Path</ja>(api=<js>"description: 'ID of order to fetch''"</js>)
* </p>
* <li>
* Multiple lines are concatenated with newlines so that you can format the value to be readable.
* <li>
* Supports {@doc DefaultRestSvlVariables}
* (e.g. <js>"$L{my.localized.variable}"</js>).
* <li>
* Values defined in this field supersede values pulled from the Swagger JSON file and are superseded by individual values defined on this annotation.
* </ul>
*/
String[] api() default {};
}