This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new fbc34fc Javadocs
fbc34fc is described below
commit fbc34fc4a8a39d637897af4528a1e424b03fa98d
Author: JamesBognar <[email protected]>
AuthorDate: Fri Jul 20 15:48:38 2018 -0400
Javadocs
---
.../org/apache/juneau/http/annotation/Body.java | 69 +++++-
.../apache/juneau/http/annotation/FormData.java | 230 +++++++++++++++++-
.../org/apache/juneau/http/annotation/Header.java | 230 +++++++++++++++++-
.../org/apache/juneau/http/annotation/Path.java | 170 ++++++++++++-
.../org/apache/juneau/http/annotation/Query.java | 230 +++++++++++++++++-
.../apache/juneau/http/annotation/RequestBean.java | 127 ++++++----
.../apache/juneau/http/annotation/Response.java | 53 ++++-
.../juneau/http/annotation/ResponseHeader.java | 204 ++++++++++++++--
.../juneau/http/annotation/ResponseStatus.java | 48 ++--
.../juneau/http/annotation/ResponseStatuses.java | 39 +++
.../apache/juneau/http/annotation/Responses.java | 45 ----
.../org/apache/juneau/http/annotation/Schema.java | 4 +-
.../http}/annotation/doc-files/Body_Example.png | Bin
.../http}/annotation/doc-files/Body_Swagger.png | Bin
juneau-doc/src/main/javadoc/overview.html | 6 +-
.../java/org/apache/juneau/rest/RestContext.java | 6 -
.../rest/annotation/ResponsesAnnotationTest.java | 265 ---------------------
17 files changed, 1259 insertions(+), 467 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
index 1d6c2c2..ea7d393 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
@@ -270,6 +270,12 @@ public @interface Body {
* <jk>public class</jk> Pet {...}
* </p>
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -296,7 +302,7 @@ public @interface Body {
* <jc>// Used on parameter</jc>
* <ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
* <jk>public void</jk> addPet(
- * <ja>@Body</ja>(required=<js>"true"</js>) Pet input
+ * <ja>@Body</ja>(required=<jk>true</jk>) Pet input
* ) {...}
* </p>
* <p class='bcode w800'>
@@ -304,14 +310,22 @@ public @interface Body {
* <ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
* <jk>public void</jk> addPet(Pet input) {...}
*
- * <ja>@Body</ja>(required=<js>"true"</js>)
+ * <ja>@Body</ja>(required=<jk>true</jk>)
* <jk>public class</jk> Pet {...}
* </p>
*
- * <h5 class='section'>Notes:</h5>
+ * <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
* <li>
- * The format is boolean.
+ * Server-side schema-based parsing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * <li>
+ * Client-side schema-based serializing validation.
+ * </ul>
+ *
+ * <h5 class='section'>Notes:</h5>
+ * <ul class='spaced-list'>
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
@@ -333,6 +347,16 @@ public @interface Body {
* This is a required attribute per the swagger definition.
* However, if not explicitly specified, the value will be
auto-generated using {@link JsonSchemaSerializer}.
*
+ * <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -441,6 +465,12 @@ public @interface Body {
* )
* </p>
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -473,6 +503,13 @@ public @interface Body {
* }
* )
* </p>
+ *
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -505,7 +542,7 @@ public @interface Body {
* <jk>public void</jk> addPet(
* <ja>@Body</ja>(
* description=<js>"Pet object to add to the
store"</js>,
- * required=<js>"true"</js>,
+ * required=<jk>true</jk>,
*
example=<js>"{name:'Doggie',price:9.99,species:'Dog',tags:['friendly','cute']}"</js>
* ) Pet input
* ) {...}
@@ -540,6 +577,12 @@ public @interface Body {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -568,20 +611,28 @@ public @interface Body {
/**
* Equivalent to {@link #value()}.
+ *
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
*/
String[] api() default {};
/**
- * TODO
+ * 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 OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
/**
- * Specifies the {@link HttpPartParser} class used for parsing values
from strings.
+ * Specifies the {@link HttpPartParser} class used for parsing strings
to values.
*
* <p>
- * The default value for this parser is inherited from the
servlet/method which defaults to {@link OpenApiPartParser}.
- * <br>You can use {@link SimplePartParser} to parse POJOs that are
directly convertible from <code>Strings</code>.
+ * Overrides for this part the part parser defined on the REST resource
which by default is {@link OpenApiPartParser}.
*/
Class<? extends HttpPartParser> parser() default
HttpPartParser.Null.class;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
index 556c420..83d001d 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
@@ -21,7 +21,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.httppart.*;
-import org.apache.juneau.urlencoding.*;
/**
* REST request form-data annotation.
@@ -242,6 +241,13 @@ public @interface FormData {
*
* <p>
* Note that <jk>null</jk> values are already ignored.
+ *
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Client-side schema-based serializing.
+ * </ul>
+ *
*/
boolean skipIfEmpty() default false;
@@ -249,20 +255,15 @@ public @interface FormData {
* Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
*
* <p>
- * The default value defaults to the using the part serializer defined
on the {@link RequestBean @RequestBean} annotation,
- * then on the client which by default is {@link UrlEncodingSerializer}.
- *
- * <p>
- * This annotation is provided to allow values to be custom serialized.
+ * Overrides for this part the part serializer defined on the REST
client which by default is {@link OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
/**
- * Specifies the {@link HttpPartParser} class used for parsing values
from strings.
+ * Specifies the {@link HttpPartParser} class used for parsing strings
to values.
*
* <p>
- * The default value for this parser is inherited from the
servlet/method which defaults to {@link OpenApiPartParser}.
- * <br>You can use {@link SimplePartParser} to parse POJOs that are
directly convertible from <code>Strings</code>.
+ * Overrides for this part the part parser defined on the REST resource
which by default is {@link OpenApiPartParser}.
*/
Class<? extends HttpPartParser> parser() default
HttpPartParser.Null.class;
@@ -320,6 +321,7 @@ public @interface FormData {
* </p>
* </li>
* </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -351,6 +353,12 @@ public @interface FormData {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -371,6 +379,16 @@ public @interface FormData {
*
* <p>
* If validation is not met during serialization or parsing, the part
serializer/parser will throw a {@link SchemaValidationException}.
+ *
+ * <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 required() default false;
@@ -419,6 +437,16 @@ public @interface FormData {
* <p>
* If the type is not specified, it will be auto-detected based on the
parameter class type.
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/#dataTypes'>Swagger specification >
Data Types</a>
@@ -470,6 +498,16 @@ public @interface FormData {
* <br>If not specified, then the input is interpreted as
plain-text and is converted to a POJO directly.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/v2/#dataTypeFormat'>Swagger
specification > Data Type Formats</a>
@@ -484,6 +522,16 @@ public @interface FormData {
* Sets the ability to pass empty-valued parameters.
* <br>This is valid only for either query or formData parameters and
allows you to send a parameter with a name only or an empty value.
* <br>The default value is <jk>false</jk>.
+ *
+ * <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 allowEmptyValue() default false;
@@ -492,9 +540,20 @@ public @interface FormData {
*
* <p>
* Describes the type of items in the array.
+ *
* <p>
* Required if <code>type</code> is <js>"array"</js>.
* <br>Can only be used if <code>type</code> 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;
@@ -523,6 +582,16 @@ public @interface FormData {
*
* <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 "";
@@ -549,6 +618,16 @@ public @interface FormData {
* <jk>@FormData</jk>(name=<js>"flags"</jk>,
collectionFormat=<js>"uon"</js>, _default=<js>"@(new-customer)"</js>) String[]
flags
* ) {...}
* </p>
+ *
+ * <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[] _default() default {};
@@ -564,6 +643,16 @@ public @interface FormData {
*
* <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 "";
@@ -579,6 +668,16 @@ public @interface FormData {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <code>maximum</code>.
+ *
+ * <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;
@@ -594,6 +693,16 @@ public @interface FormData {
*
* <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 "";
@@ -609,6 +718,16 @@ public @interface FormData {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <code>minimum</code>.
+ *
+ * <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;
@@ -625,6 +744,16 @@ public @interface FormData {
*
* <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;
@@ -641,6 +770,16 @@ public @interface FormData {
*
* <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;
@@ -655,6 +794,16 @@ public @interface FormData {
*
* <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 "";
@@ -669,6 +818,16 @@ public @interface FormData {
*
* <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;
@@ -683,6 +842,16 @@ public @interface FormData {
*
* <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;
@@ -699,6 +868,16 @@ public @interface FormData {
*
* <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;
@@ -732,6 +911,16 @@ public @interface FormData {
* ) 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 {};
@@ -746,6 +935,16 @@ public @interface FormData {
* If validation is not met during serialization or parsing, the part
serializer/parser will throw a {@link SchemaValidationException}.
*
* 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 "";
@@ -760,6 +959,12 @@ public @interface FormData {
* This attribute defines a JSON representation of the value that is
used by <code>BasicRestInfoProvider</code> to construct
* an example of the form data entry.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -817,6 +1022,12 @@ public @interface FormData {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -844,5 +1055,4 @@ public @interface FormData {
* </ul>
*/
String[] api() default {};
-
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
index 7b71cae..d974135 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
@@ -20,7 +20,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.httppart.*;
-import org.apache.juneau.urlencoding.*;
/**
* REST request header annotation.
@@ -208,6 +207,12 @@ public @interface Header {
*
* <p>
* Note that <jk>null</jk> values are already ignored.
+ *
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Client-side schema-based serializing.
+ * </ul>
*/
boolean skipIfEmpty() default false;
@@ -215,19 +220,15 @@ public @interface Header {
* Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
*
* <p>
- * The default value defaults to the using the part serializer defined
on the {@link RequestBean @RequestBean} annotation,
- * then on the client which by default is {@link UrlEncodingSerializer}.
- *
- * <p>
- * This annotation is provided to allow values to be custom serialized.
+ * Overrides for this part the part serializer defined on the REST
client which by default is {@link OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
+
/**
- * Specifies the {@link HttpPartParser} class used for parsing values
from strings.
+ * Specifies the {@link HttpPartParser} class used for parsing strings
to values.
*
* <p>
- * The default value for this parser is inherited from the
servlet/method which defaults to {@link OpenApiPartParser}.
- * <br>You can use {@link SimplePartParser} to parse POJOs that are
directly convertible from <code>Strings</code>.
+ * Overrides for this part the part parser defined on the REST resource
which by default is {@link OpenApiPartParser}.
*/
Class<? extends HttpPartParser> parser() default
HttpPartParser.Null.class;
@@ -312,6 +313,12 @@ public @interface Header {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -332,6 +339,16 @@ public @interface Header {
*
* <p>
* If validation is not met during parsing, the part parser will throw
a {@link SchemaValidationException}.
+ *
+ * <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 required() default false;
@@ -377,6 +394,16 @@ public @interface Header {
* <br>This type is currently not supported.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/#dataTypes'>Swagger specification >
Data Types</a>
@@ -428,6 +455,16 @@ public @interface Header {
* <br>If not specified, then the input is interpreted as
plain-text and is converted to a POJO directly.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/v2/#dataTypeFormat'>Swagger
specification > Data Type Formats</a>
@@ -442,6 +479,16 @@ public @interface Header {
* <p>
* Sets the ability to pass empty-valued heaver 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.
*/
@@ -452,9 +499,20 @@ public @interface Header {
*
* <p>
* Describes the type of items in the array.
+ *
* <p>
* Required if <code>type</code> is <js>"array"</js>.
* <br>Can only be used if <code>type</code> 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;
@@ -482,6 +540,16 @@ public @interface Header {
* <li>
* </ul>
*
+ * <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>
+ *
* <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.
*/
@@ -510,6 +578,16 @@ public @interface Header {
* <jk>@Header</jk>(name=<js>"X-Flags"</jk>,
collectionFormat=<js>"uon"</js>, _default=<js>"@(new-customer)"</js>) String[]
flags
* ) {...}
* </p>
+ *
+ * <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[] _default() default {};
@@ -525,6 +603,16 @@ public @interface Header {
*
* <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 "";
@@ -540,6 +628,16 @@ public @interface Header {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <code>maximum</code>.
+ *
+ * <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;
@@ -555,6 +653,16 @@ public @interface Header {
*
* <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 "";
@@ -570,6 +678,16 @@ public @interface Header {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <code>minimum</code>.
+ *
+ * <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;
@@ -586,6 +704,16 @@ public @interface Header {
*
* <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;
@@ -602,6 +730,16 @@ public @interface Header {
*
* <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;
@@ -616,6 +754,16 @@ public @interface Header {
*
* <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 "";
@@ -630,6 +778,16 @@ public @interface Header {
*
* <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;
@@ -644,6 +802,16 @@ public @interface Header {
*
* <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;
@@ -660,6 +828,16 @@ public @interface Header {
*
* <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;
@@ -693,6 +871,16 @@ public @interface Header {
* ) 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 {};
@@ -708,6 +896,16 @@ public @interface Header {
*
* <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 "";
@@ -722,6 +920,12 @@ public @interface Header {
* This attribute defines a JSON representation of the value that is
used by <code>BasicRestInfoProvider</code> to construct
* an example of the header entry.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -747,7 +951,7 @@ public @interface Header {
* <ja>@Header</ja>(
* name=<js>"api_key"</js>,
* description=<js>"Security API key"</js>,
- * required=<js>"true"</js>,
+ * required=<jk>true</jk>,
* example=<js>"foobar"</js>
* )
* </p>
@@ -781,6 +985,12 @@ public @interface Header {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
index 850246c..d4bf51b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
@@ -19,7 +19,6 @@ import java.lang.annotation.*;
import org.apache.juneau.*;
import org.apache.juneau.httppart.*;
-import org.apache.juneau.urlencoding.*;
/**
* REST request path annotation.
@@ -202,20 +201,15 @@ public @interface Path {
* Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
*
* <p>
- * The default value defaults to the using the part serializer defined
on the {@link RequestBean @RequestBean} annotation,
- * then on the client which by default is {@link UrlEncodingSerializer}.
- *
- * <p>
- * This annotation is provided to allow values to be custom serialized.
+ * Overrides for this part the part serializer defined on the REST
client which by default is {@link OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
/**
- * Specifies the {@link HttpPartParser} class used for parsing values
from strings.
+ * Specifies the {@link HttpPartParser} class used for parsing strings
to values.
*
* <p>
- * The default value for this parser is inherited from the
servlet/method which defaults to {@link OpenApiPartParser}.
- * <br>You can use {@link SimplePartParser} to parse POJOs that are
directly convertible from <code>Strings</code>.
+ * Overrides for this part the part parser defined on the REST resource
which by default is {@link OpenApiPartParser}.
*/
Class<? extends HttpPartParser> parser() default
HttpPartParser.Null.class;
@@ -317,6 +311,12 @@ public @interface Path {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -371,6 +371,16 @@ public @interface Path {
* <br>This type is currently not supported.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/#dataTypes'>Swagger specification >
Data Types</a>
@@ -422,6 +432,16 @@ public @interface Path {
* <br>If not specified, then the input is interpreted as
plain-text and is converted to a POJO directly.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/v2/#dataTypeFormat'>Swagger
specification > Data Type Formats</a>
@@ -435,6 +455,16 @@ public @interface Path {
* <p>
* Sets the ability to pass empty-valued heaver 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.
*/
@@ -448,6 +478,16 @@ public @interface Path {
* <p>
* Required if <code>type</code> is <js>"array"</js>.
* <br>Can only be used if <code>type</code> 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;
@@ -477,6 +517,16 @@ public @interface Path {
*
* <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 "";
@@ -492,6 +542,16 @@ public @interface Path {
*
* <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 "";
@@ -507,6 +567,16 @@ public @interface Path {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <code>maximum</code>.
+ *
+ * <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;
@@ -522,6 +592,16 @@ public @interface Path {
*
* <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 "";
@@ -537,6 +617,16 @@ public @interface Path {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, Must be accompanied with <code>minimum</code>.
+ *
+ * <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;
@@ -553,6 +643,16 @@ public @interface Path {
*
* <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;
@@ -569,6 +669,16 @@ public @interface Path {
*
* <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;
@@ -583,6 +693,16 @@ public @interface Path {
*
* <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 "";
@@ -618,6 +738,16 @@ public @interface Path {
* ) 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 {};
@@ -633,6 +763,16 @@ public @interface Path {
*
* <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 "";
@@ -647,6 +787,12 @@ public @interface Path {
* This attribute defines a JSON representation of the value that is
used by <code>BasicRestInfoProvider</code> to construct
* an example of the path.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -708,6 +854,12 @@ public @interface Path {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
index b06f5bf..9e81a20 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
@@ -21,7 +21,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.httppart.*;
-import org.apache.juneau.urlencoding.*;
/**
* REST request form-data annotation.
@@ -240,6 +239,12 @@ public @interface Query {
*
* <p>
* Note that <jk>null</jk> values are already ignored.
+ *
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Client-side schema-based serializing.
+ * </ul>
*/
boolean skipIfEmpty() default false;
@@ -247,20 +252,15 @@ public @interface Query {
* Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
*
* <p>
- * The default value defaults to the using the part serializer defined
on the {@link RequestBean @RequestBean} annotation,
- * then on the client which by default is {@link UrlEncodingSerializer}.
- *
- * <p>
- * This annotation is provided to allow values to be custom serialized.
+ * Overrides for this part the part serializer defined on the REST
client which by default is {@link OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
/**
- * Specifies the {@link HttpPartParser} class used for parsing values
from strings.
+ * Specifies the {@link HttpPartParser} class used for parsing strings
to values.
*
* <p>
- * The default value for this parser is inherited from the
servlet/method which defaults to {@link OpenApiPartParser}.
- * <br>You can use {@link SimplePartParser} to parse POJOs that are
directly convertible from <code>Strings</code>.
+ * Overrides for this part the part parser defined on the REST resource
which by default is {@link OpenApiPartParser}.
*/
Class<? extends HttpPartParser> parser() default
HttpPartParser.Null.class;
@@ -349,6 +349,12 @@ public @interface Query {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -369,6 +375,16 @@ public @interface Query {
*
* <p>
* If validation is not met during serialization or parsing, the part
serializer/parser will throw a {@link SchemaValidationException}.
+ *
+ * <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 required() default false;
@@ -414,6 +430,16 @@ public @interface Query {
* <br>This type is currently not supported.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/#dataTypes'>Swagger specification >
Data Types</a>
@@ -465,6 +491,16 @@ public @interface Query {
* <br>If not specified, then the input is interpreted as
plain-text and is converted to a POJO directly.
* </ul>
*
+ * <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>
+ *
* <h5 class='section'>See Also:</h5>
* <ul class='doctree'>
* <li class='link'><a class='doclink'
href='https://swagger.io/specification/v2/#dataTypeFormat'>Swagger
specification > Data Type Formats</a>
@@ -478,8 +514,19 @@ public @interface Query {
* <p>
* Sets the ability to pass empty-valued parameters.
* <br>This is valid only for either query or formData parameters and
allows you to send a parameter with a name only or an empty value.
+ *
* <p>
* The default value is <jk>false</jk>.
+ *
+ * <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 allowEmptyValue() default false;
@@ -488,9 +535,20 @@ public @interface Query {
*
* <p>
* Describes the type of items in the array.
+ *
* <p>
* Required if <code>type</code> is <js>"array"</js>.
* <br>Can only be used if <code>type</code> 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;
@@ -519,6 +577,16 @@ public @interface Query {
*
* <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 "";
@@ -545,6 +613,16 @@ public @interface Query {
* <jk>@Query</jk>(name=<js>"flags"</jk>,
collectionFormat=<js>"uon"</js>, _default=<js>"@(new-customer)"</js>) String[]
flags
* ) {...}
* </p>
+ *
+ * <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[] _default() default {};
@@ -560,6 +638,16 @@ public @interface Query {
*
* <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 "";
@@ -575,6 +663,16 @@ public @interface Query {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, must be accompanied with <code>maximum</code>.
+ *
+ * <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;
@@ -590,6 +688,16 @@ public @interface Query {
*
* <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 "";
@@ -605,6 +713,16 @@ public @interface Query {
* <p>
* Only allowed for the following types: <js>"integer"</js>,
<js>"number"</js>.
* <br>If <jk>true</jk>, Must be accompanied with <code>minimum</code>.
+ *
+ * <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;
@@ -621,6 +739,16 @@ public @interface Query {
*
* <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;
@@ -637,6 +765,16 @@ public @interface Query {
*
* <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;
@@ -651,6 +789,16 @@ public @interface Query {
*
* <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 "";
@@ -665,6 +813,16 @@ public @interface Query {
*
* <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;
@@ -679,6 +837,16 @@ public @interface Query {
*
* <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;
@@ -695,6 +863,16 @@ public @interface Query {
*
* <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;
@@ -728,6 +906,16 @@ public @interface Query {
* ) 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 {};
@@ -743,6 +931,16 @@ public @interface Query {
*
* <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 "";
@@ -757,6 +955,12 @@ public @interface Query {
* This attribute defines a JSON representation of the value that is
used by <code>BasicRestInfoProvider</code> to construct
* an example of the query entry.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -782,7 +986,7 @@ public @interface Query {
* <ja>@Query</ja>(
* name=<js>"status"</js>,
* description=<js>"Status values that need to be
considered for filter."</js>,
- * required=<js>"true"</js>,
+ * required=<jk>true</jk>,
* type=<js>"array"</js>,
* items=<ja>@Items</ja>(
* type=<js>"string"</js>,
@@ -828,6 +1032,12 @@ public @interface Query {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestBean.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestBean.java
index 739cd67..d25749a 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestBean.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestBean.java
@@ -18,12 +18,14 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import org.apache.juneau.httppart.*;
-import org.apache.juneau.urlencoding.*;
/**
* Request bean annotation.
*
* <p>
+ * Identifies an interface to use to interact with HTTP parts of an HTTP
request through a bean.
+ *
+ * <p>
* Can be used in the following locations:
* <ul>
* <li>Java method arguments and argument-types of client-side
<ja>@Remoteable</ja>-annotated REST interface proxies.
@@ -31,28 +33,25 @@ import org.apache.juneau.urlencoding.*;
* </ul>
*
* <h5 class='topic'>Server-side REST</h5>
- * TODO
*
- * <h5 class='topic'>Client-side REST</h5>
- * Annotation applied to Java method arguments of interface proxies to denote
a bean with remoteable annotations.
-
+ * Annotation that can be applied to a parameter of a
<ja>@RestMethod</ja>-annotated method to identify it as an interface for
retrieving HTTP parts through a bean interface.
+ *
* <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
- * <ja>@Remoteable</ja>(path=<js>"/myproxy"</js>)
- * <jk>public interface</jk> MyProxy {
- *
- * <ja>@RemoteMethod</ja>(path=<js>"/mymethod/{p1}/{p2}"</js>)
- * String myProxyMethod(<ja>@RequestBean</ja> MyRequestBean bean);
- * }
+ * <ja>@RestMethod</ja>(path=<js>"/mypath/{p1}/{p2}/*"</js>)
+ * <jk>public void</jk> myMethod(<ja>@RequestBean</ja> MyRequestBean rb)
{...}
*
* <jk>public interface</jk> MyRequestBean {
*
- * <ja>@Path</ja>
+ * <ja>@Path</ja> <jc>// Path variable name inferred from
getter.</jc>
* String getP1();
*
* <ja>@Path</ja>(<js>"p2"</js>)
* String getX();
*
+ * <ja>@Path</ja>(<js>"/*"</js>)
+ * String getRemainder();
+ *
* <ja>@Query</ja>
* String getQ1();
*
@@ -60,37 +59,86 @@ import org.apache.juneau.urlencoding.*;
* <ja>@BeanProperty</ja>(name=<js>"q2"</js>)
* String getQuery2();
*
- * <ja>@Query</ja>(name=<js>"q3"</js>, skipIfEmpty=<jk>true</jk>)
- * String getQuery3();
+ * <jc>// Schema-based query parameter: Pipe-delimited lists of
comma-delimited lists of integers.</jc>
+ * <ja>@Query</ja>(
+ * collectionFormat=<js>"pipes"</js>
+ * items=<ja>@Items</ja>(
+ * items=<ja>@SubItems</ja>(
+ * collectionFormat=<js>"csv"</js>
+ * type=<js>"integer"</js>
+ * )
+ * )
+ * )
+ * <jk>int</jk>[][] getQ3();
+ *
+ * <ja>@Header</ja>(<js>"*"</js>)
+ * Map<String,Object> getHeaders();
+ * </p>
+ * <p class='bcode w800'>
+ * <jc>// Same as above but annotation defined on interface.</jc>
+ * <ja>@RestMethod</ja>(path=<js>"/mypath/{p1}/{p2}/*"</js>)
+ * <jk>public void</jk> myMethod(MyRequestBean rb) {...}
+ *
+ * <ja>@RequestBean</ja>
+ * <jk>public interface</jk> MyRequestBean {...}
+ *
+ * <p>
+ * The return types of the getters must be the supported parameter types for
the HTTP-part annotation used.
+ * <br>Schema-based serialization and parsing is allowed just as if used as
individual parameter types.
+ *
+ * <p>
+ * TODO - Swagger-info in <ja>@RequestBean</ja>s is not currently reflected in
generated Swagger documentation.
+ *
+ * <h5 class='section'>See Also:</h5>
+ * <ul>
+ * <li class='link'><a class="doclink"
href="../../../../../overview-summary.html#juneau-rest-server.RequestBean">Overview
> juneau-rest-server > @RequestBean</a>
+ * </ul>
*
- * <ja>@Query</ja>(skipIfEmpty=<jk>true</jk>)
- * Map<String,Object> getExtraQueries();
+ * <h5 class='topic'>Client-side REST</h5>
*
- * <ja>@FormData</ja>
- * String getF1();
+ * Annotation applied to Java method arguments of interface proxies to denote
a bean with remoteable annotations.
+
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode w800'>
+ * <ja>@Remoteable</ja>(path=<js>"/myproxy"</js>)
+ * <jk>public interface</jk> MyProxy {
*
- * <ja>@FormData</ja>
- * <ja>@BeanProperty</ja>(name=<js>"f2"</js>)
- * String getFormData2();
+ * <ja>@RemoteMethod</ja>(path=<js>"/mymethod/{p1}/{p2}"</js>)
+ * String myProxyMethod(<ja>@RequestBean</ja> MyRequestBean bean);
+ * }
*
- * <ja>@FormData</ja>(name=<js>"f3"</js>,skipIfEmpty=<jk>true</jk>)
- * String getFormData3();
+ * <jk>public class</jk> MyRequestBean {
*
- * <ja>@FormData</ja>(skipIfEmpty=<jk>true</jk>)
- * Map<String,Object> getExtraFormData();
+ * <ja>@Path</ja> <jc>// Path variable name inferred from
getter.</jc>
+ * <jk>public</jk> String getP1() {...}
*
- * <ja>@Header</ja>
- * String getH1();
+ * <ja>@Path</ja>(<js>"p2"</js>)
+ * <jk>public</jk> String getX() {...}
*
- * <ja>@Header</ja>
- * <ja>@BeanProperty</ja>(name=<js>"H2"</js>)
- * String getHeader2();
+ * <ja>@Path</ja>(<js>"/*"</js>)
+ * <jk>public</jk> String getRemainder() {...}
*
- * <ja>@Header</ja>(name=<js>"H3"</js>,skipIfEmpty=<jk>true</jk>)
- * String getHeader3();
+ * <ja>@Query</ja>
+ * <jk>public</jk> String getQ1() {...}
*
- * <ja>@Header</ja>(skipIfEmpty=<jk>true</jk>)
- * Map<String,Object> getExtraHeaders();
+ * <ja>@Query</ja>
+ * <ja>@BeanProperty</ja>(name=<js>"q2"</js>)
+ * <jk>public</jk> String getQuery2() {...}
+ *
+ * <jc>// Schema-based query parameter: Pipe-delimited lists of
comma-delimited lists of integers.</jc>
+ * <ja>@Query</ja>(
+ * collectionFormat=<js>"pipes"</js>
+ * items=<ja>@Items</ja>(
+ * items=<ja>@SubItems</ja>(
+ * collectionFormat=<js>"csv"</js>
+ * type=<js>"integer"</js>
+ * )
+ * )
+ * )
+ * <jk>public</jk> <jk>int</jk>[][] getQ3() {...}
+ *
+ * <ja>@Header</ja>(<js>"*"</js>)
+ * <jk>public</jk> Map<String,Object> getHeaders() {...}
* }
* </p>
*
@@ -109,16 +157,15 @@ public @interface RequestBean {
* Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
*
* <p>
- * The default value defaults to the using the part serializer defined
on the client which by default is
- * {@link UrlEncodingSerializer}.
- *
- * <p>
- * This annotation is provided to allow values to be custom serialized.
+ * Overrides for this part the part serializer defined on the REST
client which by default is {@link OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
/**
- * TODO
+ * 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 OpenApiPartParser}.
*/
Class<? extends HttpPartParser> parser() default
HttpPartParser.Null.class;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
index e72c017..f3d9a36 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
@@ -89,7 +89,7 @@ import org.apache.juneau.httppart.*;
* Another example is <code>Redirect</code> which is defined like so:
*
* <p class='bcode w800'>
- * <ja>@Response<ja>(
+ * <ja>@Response</ja>(
* code=302,
* description=<js>"Redirect"</js>,
* headers={
@@ -145,8 +145,22 @@ public @interface Response {
int[] value() default {};
/**
+ * Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
+ *
+ * <p>
+ * Overrides for this part the part serializer defined on the REST
resource which by default is {@link OpenApiPartSerializer}.
+ */
+ Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
+
+ /**
* <mk>description</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#responseObject">Response</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -161,12 +175,26 @@ public @interface Response {
/**
* <mk>schema</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#responseObject">Response</a> object.
+ *
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing and serializing
validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
*/
Schema schema() default @Schema;
/**
* <mk>headers</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#responseObject">Response</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -194,6 +222,12 @@ public @interface Response {
* <br>This value is parsed from JSON into a POJO using the JSON
parser, then serialized to the various supported
* media types for the method using the registered serializers to
produce examples for all supported types.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -219,6 +253,12 @@ public @interface Response {
* <p>
* The format is a <a class='doclink'
href='../../../../../overview-summary.html#juneau-marshall.JsonDetails.SimplifiedJson'>Simplified
JSON</a> object with keys as media types and values as string representations
of the body response.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -289,6 +329,12 @@ public @interface Response {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -314,9 +360,4 @@ public @interface Response {
* </ul>
*/
String[] api() default {};
-
- /**
- * TODO
- */
- Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
index 9dc263c..1b34df7 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeader.java
@@ -50,7 +50,13 @@ import org.apache.juneau.utils.*;
* <jc>// Example #2 - Use on parameter.</jc>
* <ja>@RestMethod</ja>(...)
* <jk>public void</jk> login(
- * <ja>@ResponseHeader</ja>(name=<js>"X-Rate-Limit"</js>,
type=<js>"integer"</js>, format=<js>"int32"</js>, description=<js>"Calls per
hour allowed by the user."</js>, example=<js>"123"</js>)
+ * <ja>@ResponseHeader</ja>(
+ * name=<js>"X-Rate-Limit"</js>,
+ * type=<js>"integer"</js>,
+ * format=<js>"int32"</js>,
+ * description=<js>"Calls per hour allowed by the
user."</js>,
+ * example=<js>"123"</js>
+ * )
* Value<Integer> rateLimit
* ) {
* rateLimit.set(1000);
@@ -94,19 +100,6 @@ public @interface ResponseHeader {
*/
int[] code() default {};
-// /**
-// * The HTTP status (or statuses) of the response.
-// *
-// * <h5 class='section'>Notes:</h5>
-// * <ul class='spaced-list'>
-// * <li>
-// * The format is a comma-delimited list of HTTP status
codes that this header applies to.
-// * <li>
-// * The default value is <js>"200"</js>.
-// * </ul>
-// */
-// int[] codes() default {};
-
/**
* The HTTP header name.
*
@@ -136,16 +129,22 @@ public @interface ResponseHeader {
String value() default "";
/**
- * Specifies the {@link HttpPartSerializer} class used for serializing
values.
+ * Specifies the {@link HttpPartSerializer} class used for serializing
values to strings.
*
* <p>
- * The default value for this parser is inherited from the
servlet/method which defaults to {@link OpenApiPartSerializer}.
+ * Overrides for this part the part serializer defined on the REST
resource which by default is {@link OpenApiPartSerializer}.
*/
Class<? extends HttpPartSerializer> serializer() default
HttpPartSerializer.Null.class;
/**
* <mk>description</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -161,6 +160,14 @@ public @interface ResponseHeader {
/**
* <mk>type</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -189,6 +196,14 @@ public @interface ResponseHeader {
/**
* <mk>format</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -208,6 +223,14 @@ public @interface ResponseHeader {
/**
* <mk>collectionFormat</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -234,6 +257,12 @@ public @interface ResponseHeader {
* <p>
* Denotes a reference to a definition object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -248,6 +277,14 @@ public @interface ResponseHeader {
/**
* <mk>maximum</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -262,6 +299,14 @@ public @interface ResponseHeader {
/**
* <mk>minimum</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -276,6 +321,14 @@ public @interface ResponseHeader {
/**
* <mk>multipleOf</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -290,6 +343,14 @@ public @interface ResponseHeader {
/**
* <mk>maxLength</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -304,6 +365,14 @@ public @interface ResponseHeader {
/**
* <mk>minLength</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -316,8 +385,38 @@ public @interface ResponseHeader {
long minLength() default -1;
/**
+ * <mk>pattern</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
+ *
+ * <p>
+ * A string value is valid if it matches the specified regular
expression pattern.
+ *
+ * <p>
+ * If validation is not met during serialization, the part serializer
will throw a {@link SchemaValidationException}.
+ *
+ * <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 serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ */
+ String pattern() default "";
+
+ /**
* <mk>maxItems</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -332,6 +431,14 @@ public @interface ResponseHeader {
/**
* <mk>minItems</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -346,6 +453,14 @@ public @interface ResponseHeader {
/**
* <mk>exclusiveMaximum</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -360,6 +475,14 @@ public @interface ResponseHeader {
/**
* <mk>exclusiveMinimum</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -374,6 +497,14 @@ public @interface ResponseHeader {
/**
* <mk>uniqueItems</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -388,6 +519,14 @@ public @interface ResponseHeader {
/**
* <mk>items</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing and serializing
validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -403,6 +542,14 @@ public @interface ResponseHeader {
/**
* <mk>default</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -418,6 +565,14 @@ public @interface ResponseHeader {
/**
* <mk>enum</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#headerObject">Header</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side schema-based serializing validation.
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -437,6 +592,12 @@ public @interface ResponseHeader {
* This attribute defines a JSON representation of the body value that
is used by <code>BasicRestInfoProvider</code> to construct
* media-type-based examples of the header value.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -496,6 +657,12 @@ public @interface ResponseHeader {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -519,9 +686,4 @@ public @interface ResponseHeader {
* </ul>
*/
String[] api() default {};
-
- /**
- * TODO
- */
- String pattern() default "";
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
index 1156936..b269023 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatus.java
@@ -34,7 +34,9 @@ import org.apache.juneau.utils.*;
* This can only be applied to parameters and subclasses of the {@link Value}
class with an {@link Integer} type.
* <br>The {@link Value} object is mean to be a place-holder for the set value.
*
+ * <h5 class='section'>Examples:</h5>
* <p class='bcode w800'>
+ * <jc>// Defined on parameter.</jc>
* <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/user/login"</js>)
* <jk>public void</jk> login(String username, String password,
* <ja>@ResponseStatus</ja>(code=401,
description=<js>"Invalid user/pw"</js>) Value<Integer> status) {
@@ -42,44 +44,16 @@ import org.apache.juneau.utils.*;
* status.set(401);
* }
* </p>
- *
- * <p>
- * The {@link Responses @Responses} annotation can be used to represent
multiple possible response types.
- *
* <p class='bcode w800'>
+ * <jc>// Defined on parameter class.</jc>
* <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/user/login"</js>)
- * <jk>public void</jk> login(String username, String password,
- * <ja>@ResponseStatuses</ja>{
- * <ja>@ResponseStatus</ja>(200)
- * <ja>@ResponseStatus</ja>(code=401,
description=<js>"Invalid user/pw"</js>)
- * }
- * Value<Integer> status) {
- *
+ * <jk>public void</jk> login(String username, String password,
LoginStatus status) {
* <jk>if</jk> (! isValid(username, password))
* status.set(401);
- * <jk>else</jk>
- * status.set(200);
* }
- * </p>
- *
- * <p>
- * The other option is to apply this annotation to a subclass of {@link Value}
which often leads to a cleaner
- * REST method:
*
- * <p class='bcode w800'>
- * <ja>@ResponseStatuses</ja>{
- * <ja>@ResponseStatus</ja>(200)
- * <ja>@ResponseStatus</ja>(code=401, description=<js>"Invalid
user/pw"</js>)
- * }
+ * <ja>@ResponseStatus</ja>(code=401, description=<js>"Invalid
user/pw"</js>)
* <jk>public class</jk> LoginStatus <jk>extends</jk> Value<Integer>
{}
- *
- * <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/user/login"</js>)
- * <jk>public void</jk> login(String username, String password,
LoginStatus status) {
- * <jk>if</jk> (! isValid(username, password))
- * status.set(401);
- * <jk>else</jk>
- * status.set(200);
- * }
* </p>
*
* <p>
@@ -139,6 +113,12 @@ public @interface ResponseStatus {
/**
* <mk>description</mk> field of the Swagger <a class="doclink"
href="https://swagger.io/specification/v2/#responseObject">Response</a> object.
*
+ * <h5 class='section'>Used for:</h5>
+ * <ul class='spaced-list'>
+ * <li>
+ * Server-side generated Swagger documentation.
+ * </ul>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
@@ -194,6 +174,12 @@ public @interface ResponseStatus {
* <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>
+ *
* <h5 class='section'>Notes:</h5>
* <ul class='spaced-list'>
* <li>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatuses.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatuses.java
index ad5c8cd..1315cf7 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatuses.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatuses.java
@@ -17,12 +17,51 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.utils.*;
+
/**
* REST response statuses annotation.
*
* <p>
* Used to associate multiple {@link ResponseStatus @ResponseStatus}
annotations to the same parameter or class.
*
+ * <h5 class='section'>Example:</h5>
+ * <p class='bcode w800'>
+ * <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/user/login"</js>)
+ * <jk>public void</jk> login(String username, String password,
+ * <ja>@ResponseStatuses</ja>{
+ * <ja>@ResponseStatus</ja>(200)
+ * <ja>@ResponseStatus</ja>(code=401,
description=<js>"Invalid user/pw"</js>)
+ * }
+ * Value<Integer> status) {
+ *
+ * <jk>if</jk> (! isValid(username, password))
+ * status.set(401);
+ * <jk>else</jk>
+ * status.set(200);
+ * }
+ * </p>
+ *
+ * <p>
+ * The other option is to apply this annotation to a subclass of {@link Value}
which often leads to a cleaner
+ * REST method:
+ *
+ * <p class='bcode w800'>
+ * <ja>@ResponseStatuses</ja>{
+ * <ja>@ResponseStatus</ja>(200)
+ * <ja>@ResponseStatus</ja>(code=401, description=<js>"Invalid
user/pw"</js>)
+ * }
+ * <jk>public class</jk> LoginStatus <jk>extends</jk> Value<Integer>
{}
+ *
+ * <ja>@RestMethod</ja>(name=<js>"GET"</js>, path=<js>"/user/login"</js>)
+ * <jk>public void</jk> login(String username, String password,
LoginStatus status) {
+ * <jk>if</jk> (! isValid(username, password))
+ * status.set(401);
+ * <jk>else</jk>
+ * status.set(200);
+ * }
+ * </p>
+ *
* <p>
* Since Juneau currently prereq's Java 1.7, we cannot take advantage of
annotation duplication support in Java 8.
* <br>This annotation overcomes that limitation.
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Responses.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Responses.java
deleted file mode 100644
index 78896ed..0000000
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Responses.java
+++ /dev/null
@@ -1,45 +0,0 @@
-//
***************************************************************************************************************************
-// * 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.*;
-
-/**
- * REST responses annotation.
- *
- * Used to associate multiple {@link Response @Response} annotations to the
same parameter or class.
- *
- * <p>
- * Since Juneau currently prereq's Java 1.7, we cannot take advantage of
annotation duplication support in Java 8.
- * <br>This annotation overcomes that limitation.
- *
- * <h5 class='section'>See Also:</h5>
- * <ul>
- * <li class='link'><a class="doclink"
href="../../../../../overview-summary.html#juneau-rest-server.Responses">Overview
> juneau-rest-server > @Responses</a>
- * <li class='link'><a class="doclink"
href="../../../../../overview-summary.html#juneau-rest-server.OptionsPages">Overview
> juneau-rest-server > OPTIONS pages and Swagger</a>
- * </ul>
- */
-@Documented
-@Target({PARAMETER,TYPE})
-@Retention(RUNTIME)
-@Inherited
-public @interface Responses {
-
- /**
- * Specifies one or more {@link Response @Response} annotations to
apply to the same parameter or class.
- */
- Response[] value() default {};
-}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
index c00257b..f2c3c36 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Schema.java
@@ -395,7 +395,7 @@ public @interface Schema {
* <jc>// Used on parameter</jc>
* <ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
* <jk>public void</jk> addPet(
- * <ja>@Body</ja>(required=<js>"true"</js>) Pet input
+ * <ja>@Body</ja>(required=<jk>true</jk>) Pet input
* ) {...}
* </p>
* <p class='bcode w800'>
@@ -403,7 +403,7 @@ public @interface Schema {
* <ja>@RestMethod</ja>(name=<jsf>POST</jsf>)
* <jk>public void</jk> addPet(Pet input) {...}
*
- * <ja>@Body</ja>(required=<js>"true"</js>)
+ * <ja>@Body</ja>(required=<jk>true</jk>)
* <jk>public class</jk> Pet {...}
* </p>
*
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/doc-files/Body_Example.png
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/doc-files/Body_Example.png
similarity index 100%
rename from
juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/doc-files/Body_Example.png
rename to
juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/doc-files/Body_Example.png
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/doc-files/Body_Swagger.png
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/doc-files/Body_Swagger.png
similarity index 100%
rename from
juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/doc-files/Body_Swagger.png
rename to
juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/doc-files/Body_Swagger.png
diff --git a/juneau-doc/src/main/javadoc/overview.html
b/juneau-doc/src/main/javadoc/overview.html
index c6d0530..9390995 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -309,7 +309,7 @@
<li><p><a class='doclink'
href='#juneau-rest-server.HasQuery'>@HasQuery</a></p>
<li><p><a class='doclink'
href='#juneau-rest-server.Header'>@Header</a></p>
<li><p><a class='doclink'
href='#juneau-rest-server.Path'>@Path</a></p>
- <li><p><a class='doclink'
href='#juneau-rest-server.ResponseBean'>@ResponseBean</a></p>
+ <li><p><a class='doclink'
href='#juneau-rest-server.RequestBean'>@RequestBean</a></p>
<li><p><a class='doclink'
href='#juneau-rest-server.SwaggerSchemaPartParsing'>Swagger Schema Part
Parsing</a></p>
<li><p><a class='doclink'
href='#juneau-rest-server.Response'>@Response</a></p>
<li><p><a class='doclink'
href='#juneau-rest-server.Responses'>@Responses</a></p>
@@ -13217,9 +13217,9 @@
</ul>
</div>
- <!-- === 7.14 - @ResponseBean
======================================================================= -->
+ <!-- === 7.14 - @RequestBean
======================================================================== -->
- <h3 class='topic' onclick='toggle(this)'><a
href='#juneau-rest-server.PathRemainer'
id='juneau-rest-server.ResponseBean'>7.14 - @ResponseBean</a></h3>
+ <h3 class='topic' onclick='toggle(this)'><a
href='#juneau-rest-server.RequestBean' id='juneau-rest-server.RequestBean'>7.14
- @RequestBean</a></h3>
<div class='topic'>
TODO
</div>
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 20ddb05..3d4aa06 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -4363,12 +4363,6 @@ public final class RestContext extends BeanContext {
s = HttpPartSchema.create(ResponseStatus.class,
method, i);
rp[i] = new
RestParamDefaults.ResponseStatusObject(method, s, t);
- } else if (hasAnnotation(Responses.class, method, i)) {
- Responses a = getAnnotation(Responses.class,
method, i);
- HttpPartSchema[] ss = new
HttpPartSchema[a.value().length];
- for (int j = 0; j < ss.length; j++)
- ss[j] =
HttpPartSchema.create(a.value()[j]);
- rp[i] = new
RestParamDefaults.ResponseObject(method, ss, t);
} else if (hasAnnotation(ResponseStatuses.class,
method, i)) {
ResponseStatuses a =
getAnnotation(ResponseStatuses.class, method, i);
HttpPartSchema[] ss = new
HttpPartSchema[a.value().length];
diff --git
a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/ResponsesAnnotationTest.java
b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/ResponsesAnnotationTest.java
deleted file mode 100644
index 6cab72d..0000000
---
a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/annotation/ResponsesAnnotationTest.java
+++ /dev/null
@@ -1,265 +0,0 @@
-//
***************************************************************************************************************************
-// * 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.rest.annotation;
-
-import static org.apache.juneau.http.HttpMethodName.*;
-import static org.apache.juneau.testutils.TestUtils.*;
-import static org.junit.Assert.assertEquals;
-
-
-import org.apache.juneau.dto.swagger.*;
-import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.mock.*;
-import org.junit.*;
-import org.junit.runners.*;
-
-/**
- * Tests the @Responses annotation.
- */
-@SuppressWarnings({"javadoc"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class ResponsesAnnotationTest {
-
-
//=================================================================================================================
- // Setup
-
//=================================================================================================================
-
- private static Swagger getSwagger(Object resource) throws Exception {
- RestContext rc = RestContext.create(resource).build();
- RestRequest req = rc.getCallHandler().createRequest(new
MockServletRequest());
- RestInfoProvider ip = rc.getInfoProvider();
- return ip.getSwagger(req);
- }
-
-
//=================================================================================================================
- // @Responses on POJO
-
//=================================================================================================================
-
- @RestResource
- public static class A {
-
- @Responses({
- @Response(code=100),
- @Response(code=101)
- })
- public static class A01 {}
- @RestMethod(name=GET,path="/code")
- public void a01(A01 r) {}
-
- @Responses({
- @Response(code=100),
- @Response(code=101)
- })
- public static class A02 {}
- @RestMethod(name=GET,path="/value")
- public void a02(A02 r) {}
-
- @Responses({
- @Response(code=100, description="a"),
- @Response(code=101, description={"a","b"})
- })
- public static class A03 {}
- @RestMethod(name=GET,path="/description")
- public void a03(A03 r) {}
-
- @Responses({
- @Response(code=100, schema=@Schema(type="number")),
- @Response(code=101, schema=@Schema(" type:'integer' "))
- })
- public static class A04 {}
- @RestMethod(name=GET,path="/schema")
- public void a04(A04 r) {}
-
- @Responses({
- @Response(code=100, headers=@ResponseHeader(name="foo",
type="number")),
- @Response(code=101, headers=@ResponseHeader(name="foo",
api=" type:'integer' "))
- })
- public static class A05 {}
- @RestMethod(name=GET,path="/headers")
- public void a05(A05 r) {}
-
- @Responses({
- @Response(code=100, example="'a'"),
- @Response(code=101, example="{f1:'a'}")
- })
- public static class A06 {}
- @RestMethod(name=GET,path="/example")
- public void a06(A06 r) {}
-
- @Responses({
- @Response(code=100, examples=" {foo:'a'} "),
- @Response(code=101, examples={" foo:'b' "})
- })
- public static class A07 {}
- @RestMethod(name=GET,path="/examples")
- public void a07(A07 r) {}
- }
-
- @Test
- public void a01_Responses_onPojo_code() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/code").get("get");
- assertEquals("Continue", x.getResponse(100).getDescription());
- assertEquals("Switching Protocols",
x.getResponse(101).getDescription());
- }
- @Test
- public void a02_Responses_onPojo_value() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/value").get("get");
- assertEquals("Continue", x.getResponse(100).getDescription());
- assertEquals("Switching Protocols",
x.getResponse(101).getDescription());
- }
- @Test
- public void a03_Responses_onPojo_description() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/description").get("get");
- assertEquals("a", x.getResponse(100).getDescription());
- assertEquals("a\nb", x.getResponse(101).getDescription());
- }
- @Test
- public void a04_Responses_onPojo_schema() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/schema").get("get");
- assertObjectEquals("{type:'number'}",
x.getResponse(100).getSchema());
- assertObjectEquals("{type:'integer'}",
x.getResponse(101).getSchema());
- }
- @Test
- public void a05_Responses_onPojo_headers() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/headers").get("get");
- assertObjectEquals("{foo:{type:'number'}}",
x.getResponse(100).getHeaders());
- assertObjectEquals("{foo:{type:'integer'}}",
x.getResponse(101).getHeaders());
- }
- @Test
- public void a06_Responses_onPojo_example() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/example").get("get");
- assertObjectEquals("'a'", x.getResponse(100).getExample());
- assertObjectEquals("{f1:'a'}", x.getResponse(101).getExample());
- }
- @Test
- public void a07_Responses_onPojo_examples() throws Exception {
- Operation x = getSwagger(new
A()).getPaths().get("/examples").get("get");
- assertObjectEquals("{foo:'a'}",
x.getResponse(100).getExamples());
- assertObjectEquals("{foo:'b'}",
x.getResponse(101).getExamples());
- }
-
-
//=================================================================================================================
- // @Responses on parameter
-
//=================================================================================================================
-
- @RestResource
- public static class B {
-
- public static class B01 {}
- @RestMethod(name=GET,path="/code")
- public void b01(
- @Responses({
- @Response(code=100),
- @Response(code=101)
- })
- B01 r) {}
-
- public static class B02 {}
- @RestMethod(name=GET,path="/value")
- public void b02(
- @Responses({
- @Response(code=100),
- @Response(code=101)
- })
- B02 r) {}
-
- public static class B03 {}
- @RestMethod(name=GET,path="/description")
- public void b03(
- @Responses({
- @Response(code=100, description="a"),
- @Response(code=101, description={"a","b"})
- })
- B03 r) {}
-
- public static class B04 {}
- @RestMethod(name=GET,path="/schema")
- public void b04(
- @Responses({
- @Response(code=100,
schema=@Schema(type="number")),
- @Response(code=101, schema=@Schema("
type:'integer' "))
- })
- B04 r) {}
-
- public static class B05 {}
- @RestMethod(name=GET,path="/headers")
- public void b05(
- @Responses({
- @Response(code=100,
headers=@ResponseHeader(name="foo",type="number")),
- @Response(code=101,
headers=@ResponseHeader(name="foo", api=" type:'integer' "))
- })
- B05 r) {}
-
- public static class B06 {}
- @RestMethod(name=GET,path="/example")
- public void b06(
- @Responses({
- @Response(code=100, example=" 'a' "),
- @Response(code=101, example=" {f1:'b'} ")
- })
- B06 r) {}
-
- public static class B07 {}
- @RestMethod(name=GET,path="/examples")
- public void b07(
- @Responses({
- @Response(code=100, examples=" {foo:'a'} "),
- @Response(code=101, examples={" foo:'b' "})
- })
- B07 r) {}
- }
-
- @Test
- public void b01_Response_onParameter_code() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/code").get("get");
- assertEquals("Continue", x.getResponse(100).getDescription());
- assertEquals("Switching Protocols",
x.getResponse(101).getDescription());
- }
- @Test
- public void b02_Response_onParameter_value() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/value").get("get");
- assertEquals("Continue", x.getResponse(100).getDescription());
- assertEquals("Switching Protocols",
x.getResponse(101).getDescription());
- }
- @Test
- public void b03_Response_onParameter_description() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/description").get("get");
- assertEquals("a", x.getResponse(100).getDescription());
- assertEquals("a\nb", x.getResponse(101).getDescription());
- }
- @Test
- public void b04_Response_onParameter_schema() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/schema").get("get");
- assertObjectEquals("{type:'number'}",
x.getResponse(100).getSchema());
- assertObjectEquals("{type:'integer'}",
x.getResponse(101).getSchema());
- }
- @Test
- public void b05_Response_onParameter_headers() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/headers").get("get");
- assertObjectEquals("{foo:{type:'number'}}",
x.getResponse(100).getHeaders());
- assertObjectEquals("{foo:{type:'integer'}}",
x.getResponse(101).getHeaders());
- }
- @Test
- public void b06_Response_onParameter_example() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/example").get("get");
- assertObjectEquals("'a'", x.getResponse(100).getExample());
- assertObjectEquals("{f1:'b'}", x.getResponse(101).getExample());
- }
- @Test
- public void b07_Response_onParameter_examples() throws Exception {
- Operation x = getSwagger(new
B()).getPaths().get("/examples").get("get");
- assertObjectEquals("{foo:'a'}",
x.getResponse(100).getExamples());
- assertObjectEquals("{foo:'b'}",
x.getResponse(101).getExamples());
- }
-}