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 512fa77 Remove redundancy in HttpPart annotations.
512fa77 is described below
commit 512fa7781e6d914d762d979ba7c82e561a9cb968
Author: JamesBognar <[email protected]>
AuthorDate: Sun Nov 21 13:12:06 2021 -0500
Remove redundancy in HttpPart annotations.
---
.../org/apache/juneau/http/annotation/Body.java | 24 ------
.../juneau/http/annotation/BodyAnnotation.java | 22 +-----
.../apache/juneau/http/annotation/FormData.java | 78 ------------------
.../juneau/http/annotation/FormDataAnnotation.java | 22 +-----
.../org/apache/juneau/http/annotation/Header.java | 84 --------------------
.../juneau/http/annotation/HeaderAnnotation.java | 22 +-----
.../org/apache/juneau/http/annotation/Path.java | 82 -------------------
.../juneau/http/annotation/PathAnnotation.java | 22 +-----
.../org/apache/juneau/http/annotation/Query.java | 92 ----------------------
.../juneau/http/annotation/QueryAnnotation.java | 22 +-----
.../juneau/http/annotation/ResponseHeader.java | 76 ------------------
.../http/annotation/ResponseHeaderAnnotation.java | 22 +-----
.../juneau/rest/BasicSwaggerProviderSession.java | 12 ---
.../http/annotation/AnnotationUtils_Test.java | 6 --
.../http/annotation/BodyAnnotation_Test.java | 5 --
.../http/annotation/FormDataAnnotation_Test.java | 5 --
.../http/annotation/HeaderAnnotation_Test.java | 5 --
.../http/annotation/PathAnnotation_Test.java | 5 --
.../http/annotation/QueryAnnotation_Test.java | 5 --
.../annotation/ResponseHeaderAnnotation_Test.java | 5 --
.../juneau/httppart/HttpPartSchema_Body_Test.java | 9 +--
.../httppart/HttpPartSchema_FormData_Test.java | 9 +--
.../httppart/HttpPartSchema_Header_Test.java | 9 +--
.../juneau/httppart/HttpPartSchema_Path_Test.java | 9 +--
.../juneau/httppart/HttpPartSchema_Query_Test.java | 9 +--
.../HttpPartSchema_ResponseHeader_Test.java | 9 +--
.../rest/annotation/ResponseHeader_Test.java | 8 +-
.../rest/annotation/Swagger_FormData_Test.java | 20 +----
.../rest/annotation/Swagger_Header_Test.java | 20 +----
.../juneau/rest/annotation/Swagger_Path_Test.java | 16 +---
.../juneau/rest/annotation/Swagger_Query_Test.java | 20 +----
.../rest/annotation/Swagger_Response_Test.java | 4 +-
32 files changed, 50 insertions(+), 708 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 91835cd..aa93137 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
@@ -141,30 +141,6 @@ import org.apache.juneau.json.*;
public @interface Body {
/**
- * <p class='bcode w800'>
- * <ja>@Body</ja>({
- * <js>"description: 'Pet object to add to the
store',"</js>,
- * <js>"required: true,"</js>,
- * <js>"example:
{name:'Doggie',price:9.99,species:'Dog',tags:['friendly','cute']}"</js>
- * })
- * </p>
- * <p class='bcode w800'>
- * <ja>@Body</ja>(api={
- * <js>"description: 'Pet object to add to the
store',"</js>,
- * <js>"required: true,"</js>,
- * <js>"example:
{name:'Doggie',price:9.99,species:'Dog',tags:['friendly','cute']}"</js>
- * })
- * </p>
- *
- * <h5 class='section'>Used for:</h5>
- * <ul class='spaced-list'>
- * <li>
- * Server-side generated Swagger documentation.
- * </ul>
- */
- String[] api() default {};
-
- /**
* Synonym for {@link #description()}.
*/
String[] d() default {};
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java
index a0edafc..8b6de9e 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java
@@ -75,7 +75,6 @@ public class BodyAnnotation {
public static Body copy(Body a, VarResolverSession r) {
return
create()
- .api(r.resolve(a.api()))
.d(r.resolve(a.d()))
.description(r.resolve(a.description()))
.on(r.resolve(a.on()))
@@ -108,7 +107,7 @@ public class BodyAnnotation {
public static class Builder extends TargetedAnnotationTMBuilder {
Schema schema = SchemaAnnotation.DEFAULT;
- String[] api={}, d={}, description={};
+ String[] d={}, description={};
/**
* Constructor.
@@ -118,17 +117,6 @@ public class BodyAnnotation {
}
/**
- * Sets the {@link Body#api} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder api(String...value) {
- this.api = value;
- return this;
- }
-
- /**
* Instantiates a new {@link Body @Body} object initialized
with this builder.
*
* @return A new {@link Body @Body} object.
@@ -205,12 +193,11 @@ public class BodyAnnotation {
private static class Impl extends TargetedAnnotationTImpl implements
Body {
- private final String[] api, d, description;
+ private final String[] d, description;
private final Schema schema;
Impl(Builder b) {
super(b);
- this.api = copyOf(b.api);
this.d = copyOf(b.d);
this.description = copyOf(b.description);
this.schema = b.schema;
@@ -218,11 +205,6 @@ public class BodyAnnotation {
}
@Override /* Body */
- public String[] api() {
- return api;
- }
-
- @Override /* Body */
public String[] d() {
return d;
}
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 c94c34e..942e234 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
@@ -121,84 +121,6 @@ import org.apache.juneau.oapi.*;
public @interface FormData {
/**
- * Free-form value for the {@doc ExtSwaggerParameterObject}.
- *
- * <p>
- * This is a JSON object that makes up the swagger information for this
field.
- *
- * <p>
- * The following are completely equivalent ways of defining the swagger
description of the form post entry:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@FormData</ja>(
- * name=<js>"additionalMetadata"</js>,
- * description=<js>"Additional data to pass to
server"</js>,
- * example=<js>"Foobar"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@FormData</ja>(
- * name=<js>"additionalMetadata"</js>,
- * api={
- * <js>"description: 'Additional data to pass to
server',"</js>,
- * <js>"example: 'Foobar'"</js>
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@FormData</ja>(
- * name=<js>"additionalMetadata"</js>,
- * api=<js>"$L{additionalMetadataSwagger}"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>additionalMetadataSwagger</mk> = <mv>{ description:
"Additional data to pass to server", example: "Foobar" }</mv>
- * </p>
- *
- * <p>
- * The reasons why you may want to use this field include:
- * <ul>
- * <li>You want to pull in the entire Swagger JSON definition for
this field from an external source such as a properties file.
- * <li>You want to add extra fields to the Swagger documentation
that are not officially part of the Swagger specification.
- * </ul>
- *
- * <h5 class='section'>Used for:</h5>
- * <ul class='spaced-list'>
- * <li>
- * Server-side generated Swagger documentation.
- * </ul>
- *
- * <ul class='notes'>
- * <li>
- * Note that the only swagger field you can't specify
using this value is <js>"name"</js> whose value needs to be known during
servlet initialization.
- * <li>
- * Automatic validation is NOT performed on input based on
attributes in this value.
- * <li>
- * The format is a {@doc SimplifiedJson} object.
- * <li>
- * The leading/trailing <c>{ }</c> characters are optional.
- * <br>The following two example are considered equivalent:
- * <p class='bcode w800'>
- * <ja>@FormData</ja>(api=<js>"{example: 'Foobar'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@FormData</ja>(api=<js>"example: 'Foobar'"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <li>
- * Supports {@doc RestSvlVariables}
- * (e.g. <js>"$L{my.localized.variable}"</js>).
- * <li>
- * Values defined in this field supersede values pulled
from the Swagger JSON file and are superseded by individual values defined on
this annotation.
- * </ul>
- */
- String[] api() default {};
-
- /**
* Synonym for {@link #description()}.
*/
String[] d() default {};
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
index 3c13f57..ecafc78 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
@@ -76,7 +76,6 @@ public class FormDataAnnotation {
public static FormData copy(FormData a, VarResolverSession r) {
return
create()
- .api(r.resolve(a.api()))
.d(r.resolve(a.d()))
.description(r.resolve(a.description()))
.multi(a.multi())
@@ -119,7 +118,7 @@ public class FormDataAnnotation {
Class<? extends HttpPartSerializer> serializer =
HttpPartSerializer.Null.class;
Schema schema = SchemaAnnotation.DEFAULT;
String n="", name="", value="";
- String[] api={}, d={}, description={};
+ String[] d={}, description={};
/**
* Constructor.
@@ -138,17 +137,6 @@ public class FormDataAnnotation {
}
/**
- * Sets the {@link FormData#api} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder api(String...value) {
- this.api = value;
- return this;
- }
-
- /**
* Sets the {@link FormData#d} property on this annotation.
*
* @param value The new value for this property.
@@ -292,12 +280,11 @@ public class FormDataAnnotation {
private final Class<? extends HttpPartParser> parser;
private final Class<? extends HttpPartSerializer> serializer;
private final String n, name, value;
- private final String[] api, d, description;
+ private final String[] d, description;
private final Schema schema;
Impl(Builder b) {
super(b);
- this.api = copyOf(b.api);
this.d = copyOf(b.d);
this.description = copyOf(b.description);
this.multi = b.multi;
@@ -311,11 +298,6 @@ public class FormDataAnnotation {
}
@Override /* FormData */
- public String[] api() {
- return api;
- }
-
- @Override /* FormData */
public String[] d() {
return d;
}
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 62ef7a5..2568fb9 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
@@ -87,90 +87,6 @@ import org.apache.juneau.oapi.*;
public @interface Header {
/**
- * Free-form value for the {@doc ExtSwaggerParameterObject}.
- *
- * <p>
- * This is a JSON object that makes up the swagger information for this
field.
- *
- * <p>
- * The following are completely equivalent ways of defining the swagger
description of the request header:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Header</ja>(
- * name=<js>"api_key"</js>,
- * description=<js>"Security API key"</js>,
- * required=<jk>true</jk>,
- * example=<js>"foobar"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Header</ja>(
- * name=<js>"api_key"</js>,
- * api={
- * <js>"description: 'Security API key',"</js>,
- * <js>"required: true,"</js>,
- * <js>"example: 'foobar'"</js>
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Header</ja>(
- * name=<js>"api_key"</js>,
- * api=<js>"$L{apiKeySwagger}"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>apiKeySwagger</mk> = <mv>{ description: "Security API key",
required: true, example: "foobar" }</mv>
- * </p>
- *
- * <p>
- * The reasons why you may want to use this field include:
- * <ul>
- * <li>You want to pull in the entire Swagger JSON definition for
this field from an external source such as a properties file.
- * <li>You want to add extra fields to the Swagger documentation
that are not officially part of the Swagger specification.
- * </ul>
- *
- * <h5 class='section'>Used for:</h5>
- * <ul class='spaced-list'>
- * <li>
- * Server-side generated Swagger documentation.
- * </ul>
- *
- * <ul class='notes'>
- * <li>
- * Note that the only swagger field you can't specify
using this value is <js>"name"</js> whose value needs to be known during
servlet initialization.
- * <li>
- * The format is a {@doc SimplifiedJson} object.
- * <li>
- * Automatic validation is NOT performed on input based on
attributes in this value.
- * <li>
- * The leading/trailing <c>{ }</c> characters are optional.
- * <br>The following two example are considered equivalent:
- * <p class='bcode w800'>
- * <ja>@Header</ja>(api=<js>"{required: true}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Header</ja>(api=<js>"required: true"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <li>
- * Supports {@doc RestSvlVariables}
- * (e.g. <js>"$L{my.localized.variable}"</js>).
- * <li>
- * Values defined in this field supersede values pulled
from the Swagger JSON file and are superseded by individual values defined on
this annotation.
- * </ul>
- */
- String[] api() default {};
-
-
//=================================================================================================================
- // Attributes common to all Swagger Parameter objects
-
//=================================================================================================================
-
- /**
* Synonym for {@link #description()}.
*/
String[] d() default {};
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
index 448002b..7d1e6d2 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
@@ -76,7 +76,6 @@ public class HeaderAnnotation {
public static Header copy(Header a, VarResolverSession r) {
return
create()
- .api(r.resolve(a.api()))
.d(r.resolve(a.d()))
.description(r.resolve(a.description()))
.multi(a.multi())
@@ -119,7 +118,7 @@ public class HeaderAnnotation {
Class<? extends HttpPartSerializer> serializer =
HttpPartSerializer.Null.class;
Schema schema = SchemaAnnotation.DEFAULT;
String n="", name="", value="";
- String[] api={}, d={}, description={};
+ String[] d={}, description={};
/**
* Constructor.
@@ -138,17 +137,6 @@ public class HeaderAnnotation {
}
/**
- * Sets the {@link Header#api} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder api(String...value) {
- this.api = value;
- return this;
- }
-
- /**
* Sets the {@link Header#d} property on this annotation.
*
* @param value The new value for this property.
@@ -292,12 +280,11 @@ public class HeaderAnnotation {
private final Class<? extends HttpPartParser> parser;
private final Class<? extends HttpPartSerializer> serializer;
private final String n, name, value;
- private final String[] api, d, description;
+ private final String[] d, description;
private final Schema schema;
Impl(Builder b) {
super(b);
- this.api = copyOf(b.api);
this.d = copyOf(b.d);
this.description = copyOf(b.description);
this.multi = b.multi;
@@ -311,11 +298,6 @@ public class HeaderAnnotation {
}
@Override /* Header */
- public String[] api() {
- return api;
- }
-
- @Override /* Header */
public String[] d() {
return d;
}
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 cb4e1b6..2554b3f 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
@@ -84,88 +84,6 @@ import org.apache.juneau.oapi.*;
public @interface Path {
/**
- * Free-form value for the {@doc ExtSwaggerParameterObject}.
- *
- * <p>
- * This is a {@doc SimplifiedJson} object that makes up the swagger
information for this field.
- *
- * <p>
- * The following are completely equivalent ways of defining the swagger
description of the Path object:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Path</ja>(
- * name=<js>"orderId"</js>,
- * description=<js>"ID of order to fetch"</js>,
- * maximum=<js>"1000"</js>,
- * minimum=<js>"101"</js>,
- * example=<js>"123"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Path</ja>({
- * name=<js>"orderId"</js>,
- * api={
- * <js>"description: 'ID of order to fetch',"</js>,
- * <js>"maximum: 1000,"</js>,
- * <js>"minimum: 101,"</js>,
- * <js>"example: 123"</js>
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form using variables</jc>
- * <ja>@Path</ja>({
- * name=<js>"orderId"</js>,
- * api=<js>"$L{orderIdSwagger}"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>orderIdSwagger</mk> = <mv>{ description: "ID of order to
fetch", maximum: 1000, minimum: 101, example: 123 }</mv>
- * </p>
- *
- * <p>
- * The reasons why you may want to use this field include:
- * <ul>
- * <li>You want to pull in the entire Swagger JSON definition for
this field from an external source such as a properties file.
- * <li>You want to add extra fields to the Swagger documentation
that are not officially part of the Swagger specification.
- * </ul>
- *
- * <h5 class='section'>Used for:</h5>
- * <ul class='spaced-list'>
- * <li>
- * Server-side generated Swagger documentation.
- * </ul>
- *
- * <ul class='notes'>
- * <li>
- * Note that the only swagger field you can't specify
using this value is <js>"name"</js> whose value needs to be known during
servlet initialization.
- * <li>
- * The format is a {@doc SimplifiedJson} object.
- * <li>
- * Automatic validation is NOT performed on input based on
attributes in this value.
- * <li>
- * The leading/trailing <c>{ }</c> characters are optional.
- * <br>The following two example are considered equivalent:
- * <p class='bcode w800'>
- * <ja>@Path</ja>(api=<js>"{description: 'ID of order to
fetch'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Path</ja>(api=<js>"description: 'ID of order to
fetch''"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <li>
- * Supports {@doc RestSvlVariables}
- * (e.g. <js>"$L{my.localized.variable}"</js>).
- * <li>
- * Values defined in this field supersede values pulled
from the Swagger JSON file and are superseded by individual values defined on
this annotation.
- * </ul>
- */
- String[] api() default {};
-
- /**
* Synonym for {@link #description()}.
*/
String[] d() default {};
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
index 91fd68e..8fa8896 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
@@ -76,7 +76,6 @@ public class PathAnnotation {
public static Path copy(Path a, VarResolverSession r) {
return
create()
- .api(r.resolve(a.api()))
.d(r.resolve(a.d()))
.description(r.resolve(a.description()))
.n(r.resolve(a.n()))
@@ -117,7 +116,7 @@ public class PathAnnotation {
Class<? extends HttpPartSerializer> serializer =
HttpPartSerializer.Null.class;
Schema schema = SchemaAnnotation.DEFAULT;
String n="", name="", value="";
- String[] api={}, d={}, description={};
+ String[] d={}, description={};
/**
* Constructor.
@@ -136,17 +135,6 @@ public class PathAnnotation {
}
/**
- * Sets the {@link Path#api} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder api(String...value) {
- this.api = value;
- return this;
- }
-
- /**
* Sets the {@link Path#d} property on this annotation.
*
* @param value The new value for this property.
@@ -278,12 +266,11 @@ public class PathAnnotation {
private final Class<? extends HttpPartParser> parser;
private final Class<? extends HttpPartSerializer> serializer;
private final String n, name, value;
- private final String[] api, d, description;
+ private final String[] d, description;
private final Schema schema;
Impl(Builder b) {
super(b);
- this.api = copyOf(b.api);
this.d = copyOf(b.d);
this.description = copyOf(b.description);
this.n = b.n;
@@ -296,11 +283,6 @@ public class PathAnnotation {
}
@Override /* Path */
- public String[] api() {
- return api;
- }
-
- @Override /* Path */
public String[] d() {
return d;
}
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 f80a202..34ff34a 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
@@ -95,98 +95,6 @@ import org.apache.juneau.oapi.*;
public @interface Query {
/**
- * Free-form value for the {@doc ExtSwaggerParameterObject}.
- *
- * <p>
- * This is a {@doc SimplifiedJson} object that makes up the swagger
information for this field.
- *
- * <p>
- * The following are completely equivalent ways of defining the swagger
description of the Query object:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * description=<js>"Status values that need to be
considered for filter."</js>,
- * required=<jk>true</jk>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>(
- * type=<js>"string"</js>,
- * _enum=<js>"AVAILABLE,PENDING,SOLD"</js>,
- * _default=<js>"AVAILABLE"</js>
- * ),
- * example=<js>"['AVAILABLE','PENDING']"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * api={
- * <js>"description: 'Status values that need to
be considered for filter.',"</js>,
- * <js>"required: true,"</js>,
- * <js>"type: 'array',"</js>,
- * <js>"items: {"</js>,
- * <js>"type: 'string',"</js>,
- * <js>"enum:
'AVAILABLE,PENDING,SOLD',"</js>,
- * <js>"default: 'AVAILABLE'"</js>,
- * <js>"}"</js>,
- * <js>"example: "['AVAILABLE','PENDING']"</js>
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form using variables</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * api=<js>"$L{statusSwagger}"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>statusSwagger</mk> = <mv>{ description: "Status values that
need to be considered for filter.", required: true, type: "array", items:
{type: "string", enum: "AVAILABLE,PENDING,SOLD", default: "AVAILABLE"},
example: "['AVAILABLE','PENDING']" } }</mv>
- * </p>
- *
- * <p>
- * The reasons why you may want to use this field include:
- * <ul>
- * <li>You want to pull in the entire Swagger JSON definition for
this field from an external source such as a properties file.
- * <li>You want to add extra fields to the Swagger documentation
that are not officially part of the Swagger specification.
- * </ul>
- *
- * <h5 class='section'>Used for:</h5>
- * <ul class='spaced-list'>
- * <li>
- * Server-side generated Swagger documentation.
- * </ul>
- *
- * <ul class='notes'>
- * <li>
- * Note that the only swagger field you can't specify
using this value is <js>"name"</js> whose value needs to be known during
servlet initialization.
- * <li>
- * Automatic validation is NOT performed on input based on
attributes in this value.
- * <li>
- * The format is a {@doc SimplifiedJson} object.
- * <li>
- * The leading/trailing <c>{ }</c> characters are optional.
- * <br>The following two example are considered equivalent:
- * <p class='bcode w800'>
- * <ja>@Query</ja>(api=<js>"{description: 'ID of order to
fetch'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Query</ja>(api=<js>"description: 'ID of order to
fetch''"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <li>
- * Supports {@doc RestSvlVariables}
- * (e.g. <js>"$L{my.localized.variable}"</js>).
- * <li>
- * Values defined in this field supersede values pulled
from the Swagger JSON file and are superseded by individual values defined on
this annotation.
- * </ul>
- */
- String[] api() default {};
-
- /**
* Synonym for {@link #description()}.
*/
String[] d() default {};
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
index 359688d..d7dbabd 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
@@ -76,7 +76,6 @@ public class QueryAnnotation {
public static Query copy(Query a, VarResolverSession r) {
return
create()
- .api(r.resolve(a.api()))
.d(r.resolve(a.d()))
.description(r.resolve(a.description()))
.multi(a.multi())
@@ -119,7 +118,7 @@ public class QueryAnnotation {
Class<? extends HttpPartSerializer> serializer =
HttpPartSerializer.Null.class;
Schema schema = SchemaAnnotation.DEFAULT;
String n="", name="", value="";
- String[] api={}, d={}, description={};
+ String[] d={}, description={};
/**
* Constructor.
@@ -138,17 +137,6 @@ public class QueryAnnotation {
}
/**
- * Sets the {@link Query#api} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder api(String...value) {
- this.api = value;
- return this;
- }
-
- /**
* Sets the {@link Query#d} property on this annotation.
*
* @param value The new value for this property.
@@ -292,12 +280,11 @@ public class QueryAnnotation {
private final Class<? extends HttpPartParser> parser;
private final Class<? extends HttpPartSerializer> serializer;
private final String n, name, value;
- private final String[] api, d, description;
+ private final String[] d, description;
private final Schema schema;
Impl(Builder b) {
super(b);
- this.api = copyOf(b.api);
this.d = copyOf(b.d);
this.description = copyOf(b.description);
this.multi = b.multi;
@@ -311,11 +298,6 @@ public class QueryAnnotation {
}
@Override /* Query */
- public String[] api() {
- return api;
- }
-
- @Override /* Query */
public String[] d() {
return d;
}
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 57fe646..e452c0f 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
@@ -134,82 +134,6 @@ import org.apache.juneau.oapi.*;
public @interface ResponseHeader {
/**
- * Free-form value for the {@doc ExtSwaggerHeaderObject}.
- *
- * <p>
- * This is a {@doc SimplifiedJson} object that makes up the swagger
information for this field.
- *
- * <p>
- * The following are completely equivalent ways of defining the swagger
description of the Header object:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@ResponseHeader</ja>(
- * name=<js>"Location"</js>,
- * description=<js>"The new location of this
resource"</js>,
- * type=<js>"string"</js>,
- * format=<js>"uri"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@ResponseHeader</ja>(
- * name=<js>"Location"</js>,
- * api={
- * <js>"description: 'The new location of this
resource',"</js>,
- * <js>"type: 'string',"</js>,
- * <js>"format: 'uri'"</js>
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form using variables</jc>
- * <ja>@ResponseHeader</ja>(
- * name=<js>"Location"</js>,
- * api=<js>"$L{locationSwagger}"</js>
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>locationSwagger</mk> = <mv>{ description: "The new location
of this resource", type: "string", format: "uri" }</mv>
- * </p>
- *
- * <p>
- * The reasons why you may want to use this field include:
- * <ul>
- * <li>You want to pull in the entire Swagger JSON definition for
this body from an external source such as a properties file.
- * <li>You want to add extra fields to the Swagger documentation
that are not officially part of the Swagger specification.
- * </ul>
- *
- * <h5 class='section'>Used for:</h5>
- * <ul class='spaced-list'>
- * <li>
- * Server-side generated Swagger documentation.
- * </ul>
- *
- * <ul class='notes'>
- * <li>
- * Note that the only swagger field you can't specify
using this value is <js>"name"</js> whose value needs to be known during
servlet initialization.
- * <li>
- * The format is a {@doc SimplifiedJson} object.
- * <li>
- * The leading/trailing <c>{ }</c> characters are optional.
- * <br>The following two example are considered equivalent:
- * <p class='bcode w800'>
- * <ja>@ResponseHeader</ja>(<js>"{description:'The new location of
this resource'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@ResponseHeader</ja>(<js>"description:'The new location of
this resource'"</js>)
- * </p>
- * <li>
- * Supports {@doc RestSvlVariables}
- * (e.g. <js>"$L{my.localized.variable}"</js>).
- * <li>
- * Values defined in this field supersede values pulled
from the Swagger JSON file and are superseded by individual values defined on
this annotation.
- * </ul>
- */
- String[] api() default {};
-
- /**
* The HTTP status (or statuses) of the response.
*
* <ul class='notes'>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
index 550b646..15368f5 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
@@ -77,7 +77,6 @@ public class ResponseHeaderAnnotation {
public static ResponseHeader copy(ResponseHeader a, VarResolverSession
r) {
return
create()
- .api(r.resolve(a.api()))
.code(a.code())
.d(r.resolve(a.d()))
.description(r.resolve(a.description()))
@@ -132,7 +131,7 @@ public class ResponseHeaderAnnotation {
int[] code={};
Schema schema = SchemaAnnotation.DEFAULT;
String n="", name="", value="";
- String[] api={}, d={}, description={};
+ String[] d={}, description={};
/**
* Constructor.
@@ -151,17 +150,6 @@ public class ResponseHeaderAnnotation {
}
/**
- * Sets the {@link ResponseHeader#api} property on this
annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder api(String...value) {
- this.api = value;
- return this;
- }
-
- /**
* Sets the {@link ResponseHeader#code} property on this
annotation.
*
* @param value The new value for this property.
@@ -287,12 +275,11 @@ public class ResponseHeaderAnnotation {
private final Class<? extends HttpPartSerializer> serializer;
private final int[] code;
private final String n, name, value;
- private final String[] api, d, description;
+ private final String[] d, description;
private final Schema schema;
Impl(Builder b) {
super(b);
- this.api = copyOf(b.api);
this.code = Arrays.copyOf(b.code, b.code.length);
this.d = copyOf(b.d);
this.description = copyOf(b.description);
@@ -305,11 +292,6 @@ public class ResponseHeaderAnnotation {
}
@Override /* ResponseHeader */
- public String[] api() {
- return api;
- }
-
- @Override /* ResponseHeader */
public int[] code() {
return code;
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProviderSession.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProviderSession.java
index 9b4597a..e709ea2 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProviderSession.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProviderSession.java
@@ -945,8 +945,6 @@ public class BasicSwaggerProviderSession {
if (BodyAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.api().length > 0)
- om.putAll(parseMap(a.api()));
if (! SchemaAnnotation.empty(a.schema()))
merge(om, a.schema());
return om
@@ -958,8 +956,6 @@ public class BasicSwaggerProviderSession {
if (QueryAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.api().length > 0)
- om.putAll(parseMap(a.api()));
if (! SchemaAnnotation.empty(a.schema()))
merge(om, a.schema());
return om
@@ -971,8 +967,6 @@ public class BasicSwaggerProviderSession {
if (FormDataAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.api().length > 0)
- om.putAll(parseMap(a.api()));
if (! SchemaAnnotation.empty(a.schema()))
merge(om, a.schema());
return om
@@ -984,8 +978,6 @@ public class BasicSwaggerProviderSession {
if (HeaderAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.api().length > 0)
- om.putAll(parseMap(a.api()));
if (! SchemaAnnotation.empty(a.schema()))
merge(om, a.schema());
return om
@@ -997,8 +989,6 @@ public class BasicSwaggerProviderSession {
if (PathAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.api().length > 0)
- om.putAll(parseMap(a.api()));
if (! SchemaAnnotation.empty(a.schema()))
merge(om, a.schema());
return om
@@ -1147,8 +1137,6 @@ public class BasicSwaggerProviderSession {
if (ResponseHeaderAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.api().length > 0)
- om.putAll(parseMap(a.api()));
if (! SchemaAnnotation.empty(a.schema()))
merge(om, a.schema());
return om
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
index a975574..3fa6436 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
@@ -64,7 +64,6 @@ public class AnnotationUtils_Test {
assertTrue(BodyAnnotation.empty(body().build()));
assertTrue(BodyAnnotation.empty((Body)null));
- assertFalse(BodyAnnotation.empty(body().api(a("foo")).build()));
assertFalse(BodyAnnotation.empty(body().d(a("foo")).build()));
assertFalse(BodyAnnotation.empty(body().description(a("foo")).build()));
}
@@ -97,7 +96,6 @@ public class AnnotationUtils_Test {
assertTrue(FormDataAnnotation.empty((FormData)null));
assertTrue(FormDataAnnotation.empty(formData().build()));
-
assertFalse(FormDataAnnotation.empty(formData().api(a("foo")).build()));
assertFalse(FormDataAnnotation.empty(formData().d(a("foo")).build()));
assertFalse(FormDataAnnotation.empty(formData().description(a("foo")).build()));
assertFalse(FormDataAnnotation.empty(formData().multi(true).build()));
@@ -129,7 +127,6 @@ public class AnnotationUtils_Test {
assertTrue(QueryAnnotation.empty((Query)null));
assertTrue(QueryAnnotation.empty(query().build()));
-
assertFalse(QueryAnnotation.empty(query().api(a("foo")).build()));
assertFalse(QueryAnnotation.empty(query().d(a("foo")).build()));
assertFalse(QueryAnnotation.empty(query().description(a("foo")).build()));
assertFalse(QueryAnnotation.empty(query().multi(true).build()));
@@ -161,7 +158,6 @@ public class AnnotationUtils_Test {
assertTrue(HeaderAnnotation.empty((Header)null));
assertTrue(HeaderAnnotation.empty(header().build()));
-
assertFalse(HeaderAnnotation.empty(header().api(a("foo")).build()));
assertFalse(HeaderAnnotation.empty(header().d(a("foo")).build()));
assertFalse(HeaderAnnotation.empty(header().description(a("foo")).build()));
assertFalse(HeaderAnnotation.empty(header().multi(true).build()));
@@ -199,7 +195,6 @@ public class AnnotationUtils_Test {
assertTrue(PathAnnotation.empty((Path)null));
assertTrue(PathAnnotation.empty(path().build()));
- assertFalse(PathAnnotation.empty(path().api(a("foo")).build()));
assertFalse(PathAnnotation.empty(path().d(a("foo")).build()));
assertFalse(PathAnnotation.empty(path().description(a("foo")).build()));
assertFalse(PathAnnotation.empty(path().n("foo").build()));
@@ -253,7 +248,6 @@ public class AnnotationUtils_Test {
assertTrue(ResponseHeaderAnnotation.empty(A1.class.getAnnotation(ResponseHeader.class)));
assertTrue(ResponseHeaderAnnotation.empty(A2.class.getAnnotation(ResponseHeader.class)));
-
assertFalse(ResponseHeaderAnnotation.empty(responseHeader().api(a("foo")).build()));
assertFalse(ResponseHeaderAnnotation.empty(responseHeader().code(a(0)).build()));
assertFalse(ResponseHeaderAnnotation.empty(responseHeader().d(a("foo")).build()));
assertFalse(ResponseHeaderAnnotation.empty(responseHeader().description(a("foo")).build()));
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/BodyAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/BodyAnnotation_Test.java
index 174f3e6..e400ad4 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/BodyAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/BodyAnnotation_Test.java
@@ -31,7 +31,6 @@ public class BodyAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
Body a1 = BodyAnnotation.create()
- .api("api")
.d("d")
.description("description")
.on("on")
@@ -39,7 +38,6 @@ public class BodyAnnotation_Test {
.build();
Body a2 = BodyAnnotation.create()
- .api("api")
.d("d")
.description("description")
.on("on")
@@ -50,7 +48,6 @@ public class BodyAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().matches(""
+ "{"
- + "api:['api'],"
+ "d:['d'],"
+ "description:['description'],"
+ "on:['on'],"
@@ -106,7 +103,6 @@ public class BodyAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
@Body(
- api="api",
d="d",
description="description",
on="on",
@@ -116,7 +112,6 @@ public class BodyAnnotation_Test {
Body d1 = D1.class.getAnnotationsByType(Body.class)[0];
@Body(
- api="api",
d="d",
description="description",
on="on",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/FormDataAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/FormDataAnnotation_Test.java
index e45ad6d..c49f9b9 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/FormDataAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/FormDataAnnotation_Test.java
@@ -32,7 +32,6 @@ public class FormDataAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
FormData a1 = FormDataAnnotation.create()
- .api("api")
.d("d")
.description("description")
.multi(true)
@@ -46,7 +45,6 @@ public class FormDataAnnotation_Test {
.build();
FormData a2 = FormDataAnnotation.create()
- .api("api")
.d("d")
.description("description")
.multi(true)
@@ -63,7 +61,6 @@ public class FormDataAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().matches(""
+ "{"
- + "api:['api'],"
+ "d:['d'],"
+ "description:['description'],"
+ "multi:true,"
@@ -127,7 +124,6 @@ public class FormDataAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
@FormData(
- api="api",
d="d",
description="description",
multi=true,
@@ -143,7 +139,6 @@ public class FormDataAnnotation_Test {
FormData d1 = D1.class.getAnnotationsByType(FormData.class)[0];
@FormData(
- api="api",
d="d",
description="description",
multi=true,
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/HeaderAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/HeaderAnnotation_Test.java
index 98e1eb1..6bdef5f 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/HeaderAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/HeaderAnnotation_Test.java
@@ -32,7 +32,6 @@ public class HeaderAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
Header a1 = HeaderAnnotation.create()
- .api("api")
.d("d")
.description("description")
.multi(true)
@@ -46,7 +45,6 @@ public class HeaderAnnotation_Test {
.build();
Header a2 = HeaderAnnotation.create()
- .api("api")
.d("d")
.description("description")
.multi(true)
@@ -63,7 +61,6 @@ public class HeaderAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().matches(""
+ "{"
- + "api:['api'],"
+ "d:['d'],"
+ "description:['description'],"
+ "multi:true,"
@@ -127,7 +124,6 @@ public class HeaderAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
@Header(
- api="api",
d="d",
description="description",
multi=true,
@@ -143,7 +139,6 @@ public class HeaderAnnotation_Test {
Header d1 = D1.class.getAnnotationsByType(Header.class)[0];
@Header(
- api="api",
d="d",
description="description",
multi=true,
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/PathAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/PathAnnotation_Test.java
index 51a7521..ebee6e4 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/PathAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/PathAnnotation_Test.java
@@ -32,7 +32,6 @@ public class PathAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
Path a1 = PathAnnotation.create()
- .api("api")
.d("d")
.description("description")
.n("n")
@@ -45,7 +44,6 @@ public class PathAnnotation_Test {
.build();
Path a2 = PathAnnotation.create()
- .api("api")
.d("d")
.description("description")
.n("n")
@@ -61,7 +59,6 @@ public class PathAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().matches(""
+ "{"
- + "api:['api'],"
+ "d:['d'],"
+ "description:['description'],"
+ "n:'n',"
@@ -124,7 +121,6 @@ public class PathAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
@Path(
- api="api",
d="d",
description="description",
n="n",
@@ -139,7 +135,6 @@ public class PathAnnotation_Test {
Path d1 = D1.class.getAnnotationsByType(Path.class)[0];
@Path(
- api="api",
d="d",
description="description",
n="n",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/QueryAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/QueryAnnotation_Test.java
index 32c5bc1..1545f98 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/QueryAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/QueryAnnotation_Test.java
@@ -32,7 +32,6 @@ public class QueryAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
Query a1 = QueryAnnotation.create()
- .api("api")
.d("d")
.description("description")
.multi(true)
@@ -46,7 +45,6 @@ public class QueryAnnotation_Test {
.build();
Query a2 = QueryAnnotation.create()
- .api("api")
.d("d")
.description("description")
.multi(true)
@@ -63,7 +61,6 @@ public class QueryAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().matches(""
+ "{"
- + "api:['api'],"
+ "d:['d'],"
+ "description:['description'],"
+ "multi:true,"
@@ -127,7 +124,6 @@ public class QueryAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
@Query(
- api="api",
d="d",
description="description",
multi=true,
@@ -143,7 +139,6 @@ public class QueryAnnotation_Test {
Query d1 = D1.class.getAnnotationsByType(Query.class)[0];
@Query(
- api="api",
d="d",
description="description",
multi=true,
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation_Test.java
index b064363..bf34bef 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation_Test.java
@@ -32,7 +32,6 @@ public class ResponseHeaderAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
ResponseHeader a1 = ResponseHeaderAnnotation.create()
- .api("api")
.code(1)
.d("d")
.description("description")
@@ -45,7 +44,6 @@ public class ResponseHeaderAnnotation_Test {
.build();
ResponseHeader a2 = ResponseHeaderAnnotation.create()
- .api("api")
.code(1)
.d("d")
.description("description")
@@ -61,7 +59,6 @@ public class ResponseHeaderAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().matches(""
+ "{"
- + "api:['api'],"
+ "code:[1],"
+ "d:['d'],"
+ "description:['description'],"
@@ -122,7 +119,6 @@ public class ResponseHeaderAnnotation_Test {
//------------------------------------------------------------------------------------------------------------------
@ResponseHeader(
- api="api",
code=1,
d="d",
description="description",
@@ -137,7 +133,6 @@ public class ResponseHeaderAnnotation_Test {
ResponseHeader d1 =
D1.class.getAnnotationsByType(ResponseHeader.class)[0];
@ResponseHeader(
- api="api",
code=1,
d="d",
description="description",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Body_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Body_Test.java
index 4b65fb7..da2b24b 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Body_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Body_Test.java
@@ -38,8 +38,7 @@ public class HttpPartSchema_Body_Test {
//-----------------------------------------------------------------------------------------------------------------
@Body(
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
$ref="c1",
@@ -56,8 +55,7 @@ public class HttpPartSchema_Body_Test {
public static class A03 {
public void a(
@Body(
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
$ref="c1",
@@ -79,8 +77,7 @@ public class HttpPartSchema_Body_Test {
public static class A04 {
public void a(
@Body(
- d={"b3","b3"},
- api="{g2:true}"
+ d={"b3","b3"}
)
@Schema(
$ref="c3",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_FormData_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_FormData_Test.java
index 90f848b..b35e390 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_FormData_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_FormData_Test.java
@@ -48,8 +48,7 @@ public class HttpPartSchema_FormData_Test {
@FormData(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -103,8 +102,7 @@ public class HttpPartSchema_FormData_Test {
public void a(
@FormData(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -163,8 +161,7 @@ public class HttpPartSchema_FormData_Test {
public void a(
@FormData(
n="y",
- d={"b3","b3"},
- api="{g2:true}"
+ d={"b3","b3"}
)
@Schema(
t="integer",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Header_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Header_Test.java
index a17c365..9e59986 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Header_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Header_Test.java
@@ -50,8 +50,7 @@ public class HttpPartSchema_Header_Test {
@Header(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -105,8 +104,7 @@ public class HttpPartSchema_Header_Test {
public void a(
@Header(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -165,8 +163,7 @@ public class HttpPartSchema_Header_Test {
public void a(
@Header(
n="y",
- d={"b3","b3"},
- api="{g2:true}"
+ d={"b3","b3"}
)
@Schema(
t="integer",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Path_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Path_Test.java
index ad581a4..d1663b8 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Path_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Path_Test.java
@@ -50,8 +50,7 @@ public class HttpPartSchema_Path_Test {
@Path(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -93,8 +92,7 @@ public class HttpPartSchema_Path_Test {
public void a(
@Path(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -141,8 +139,7 @@ public class HttpPartSchema_Path_Test {
public void a(
@Path(
n="y",
- d={"b3","b3"},
- api="{g2:true}"
+ d={"b3","b3"}
)
@Schema(
t="integer",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Query_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Query_Test.java
index 6592b57..9150f6a 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Query_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Query_Test.java
@@ -50,8 +50,7 @@ public class HttpPartSchema_Query_Test {
@Query(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -105,8 +104,7 @@ public class HttpPartSchema_Query_Test {
public void a(
@Query(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -165,8 +163,7 @@ public class HttpPartSchema_Query_Test {
public void a(
@Query(
n="y",
- d={"b3","b3"},
- api="{g2:true}"
+ d={"b3","b3"}
)
@Schema(
t="integer",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_ResponseHeader_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_ResponseHeader_Test.java
index bcc2841..f32a5e6 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_ResponseHeader_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_ResponseHeader_Test.java
@@ -50,8 +50,7 @@ public class HttpPartSchema_ResponseHeader_Test {
@ResponseHeader(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -101,8 +100,7 @@ public class HttpPartSchema_ResponseHeader_Test {
public void a(
@ResponseHeader(
n="x",
- d={"b1","b2"},
- api="{g1:true}"
+ d={"b1","b2"}
)
@Schema(
t="number",
@@ -157,8 +155,7 @@ public class HttpPartSchema_ResponseHeader_Test {
public void a(
@ResponseHeader(
n="y",
- d={"b3","b3"},
- api="{g2:true}"
+ d={"b3","b3"}
)
@Schema(
t="integer",
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeader_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeader_Test.java
index 6e18d83..c104194 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeader_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/ResponseHeader_Test.java
@@ -184,11 +184,9 @@ public class ResponseHeader_Test {
public void b(
@ResponseHeader(
name="H",
- api={
- "description:'a',",
- "type:'string'"
- }
- ) Value<C2> h) {}
+
schema=@Schema("{description:'a',type:'string'}")
+ )
+ Value<C2> h) {}
public static class C3 {}
@RestGet
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_FormData_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_FormData_Test.java
index 04ca2be..b99c8f3 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_FormData_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_FormData_Test.java
@@ -46,10 +46,7 @@ public class Swagger_FormData_Test {
@FormData(
name="F",
- api={
- "description:'a\nb',",
- "type:'string'"
- }
+ schema=@Schema("{description:'a\nb',type:'string'}")
)
public static class A2 {
public A2(String x) {}
@@ -59,10 +56,7 @@ public class Swagger_FormData_Test {
@FormData(
name="F",
- api={
- "description:'b\nc',",
- "type:'string'"
- },
+ schema=@Schema("{description:'b\nc',type:'string'}"),
description= {"a","b"}
)
@Schema(type="string")
@@ -164,20 +158,14 @@ public class Swagger_FormData_Test {
public void b(
@FormData(
name="F",
- api={
- "description:'a\nb',",
- "type:'string'",
- }
+
schema=@Schema("{description:'a\nb',type:'string'}")
) String f) {}
@RestPost
public void c(
@FormData(
name="F",
- api={
- "description:'b\nc',",
- "type:'string'",
- },
+
schema=@Schema("{description:'b\nc',type:'string'}"),
description={"a","b"}
)
@Schema(type="string")
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Header_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Header_Test.java
index 659c53e..e6192ca 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Header_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Header_Test.java
@@ -46,10 +46,7 @@ public class Swagger_Header_Test {
@Header(
name="H",
- api={
- "description:'a\nb',",
- "type:'string'"
- }
+ schema=@Schema("{description:'a\nb',type:'string'}")
)
public static class A2 {
public A2(String x) {}
@@ -59,10 +56,7 @@ public class Swagger_Header_Test {
@Header(
name="H",
- api={
- "description:'b\nc',",
- "type:'string'"
- },
+ schema=@Schema("{description:'b\nc',type:'string'}"),
description={"a","b"}
)
@Schema(type="string")
@@ -153,20 +147,14 @@ public class Swagger_Header_Test {
public void b(
@Header(
name="H",
- api={
- "description:'a\nb',",
- "type:'string'",
- }
+
schema=@Schema("{description:'a\nb',type:'string'}")
) String h) {}
@RestPost
public void c(
@Header(
name="H",
- api={
- "description:'b\nc',",
- "type:'string'",
- },
+
schema=@Schema("{description:'b\nc',type:'string'}"),
description={"a","b"}
)
@Schema(type="string")
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Path_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Path_Test.java
index aac3fd5..b09c205 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Path_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Path_Test.java
@@ -53,11 +53,7 @@ public class Swagger_Path_Test {
@Path(
n="P",
- api={
- "description:'a\nb',",
- "type:'string',",
- "enum:['a','b']"
- }
+
schema=@Schema("{description:'a\nb',type:'string',enum:['a','b']}")
)
public static class A2 {
public A2(String x) {}
@@ -206,19 +202,13 @@ public class Swagger_Path_Test {
@RestPut(path="/b/{P}")
public void b(@Path(
n="P",
- api={
- "description:'a',",
- "type:'string'"
- }
+ schema=@Schema("{description:'a',type:'string'}")
) String h) {}
@RestPost(path="/c/{P}")
public void c(@Path(
n="P",
- api={
- "description:'b',",
- "type:'string'"
- },
+ schema=@Schema("{description:'b',type:'string'}"),
d="a"
)
@Schema(t="string")
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Query_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Query_Test.java
index f9f9567..c2e3b87 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Query_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Query_Test.java
@@ -46,10 +46,7 @@ public class Swagger_Query_Test {
@Query(
n="Q",
- api={
- "description: 'a\nb',",
- "type:'string'"
- }
+ schema=@Schema("{description: 'a\nb',type:'string'}")
)
public static class A2 {
public A2(String x) {}
@@ -59,10 +56,7 @@ public class Swagger_Query_Test {
@Query(
n="Q",
- api={
- "description: 'b\nc',",
- "type:'string'"
- },
+ schema=@Schema("{description: 'b\nc',type:'string'}"),
d={"a","b"}
)
@Schema(t="string")
@@ -164,10 +158,7 @@ public class Swagger_Query_Test {
public void b(
@Query(
n="Q",
- api={
- "description: 'a\nb',",
- "type:'string'"
- }
+ schema=@Schema("{description:
'a\nb',type:'string'}")
)
String q) {}
@@ -175,10 +166,7 @@ public class Swagger_Query_Test {
public void c(
@Query(
n="Q",
- api={
- "description: 'b\nc',",
- "type:'string'"
- },
+ schema=@Schema("{description:
'b\nc',type:'string'}"),
d= {"a","b"}
)
@Schema(t="string")
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Response_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Response_Test.java
index 819d4b6..a264ba1 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Response_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Response_Test.java
@@ -103,7 +103,7 @@ public class Swagger_Response_Test {
@RestOp
public A5 j() {return null;}
- @Response(headers=@ResponseHeader(name="foo",api=" type:'b' "))
+
@Response(headers=@ResponseHeader(name="foo",schema=@Schema("{type:'b'}")))
public static class A6 {}
@RestOp
public void k(Value<A6> r) {}
@@ -338,7 +338,7 @@ public class Swagger_Response_Test {
@RestOp
public void e() throws D5 {}
- @Response(headers=@ResponseHeader(name="foo", api="
{type:'number'} "))
+ @Response(headers=@ResponseHeader(name="foo", schema=@Schema("
{type:'number'} ")))
public static class D6 extends Throwable {}
@RestOp
public void f() throws D6 {}