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 6f44f3a Remove redundancy in HttpPart annotations.
6f44f3a is described below
commit 6f44f3a39cee80d4ad5b37ad71196aef0905ca39
Author: JamesBognar <[email protected]>
AuthorDate: Mon Nov 22 12:54:35 2021 -0500
Remove redundancy in HttpPart annotations.
---
.../juneau/html/HtmlSchemaDocSerializer.java | 25 -----
.../apache/juneau/html/HtmlSchemaSerializer.java | 24 -----
.../org/apache/juneau/http/annotation/Contact.java | 89 +----------------
.../juneau/http/annotation/ContactAnnotation.java | 39 --------
.../juneau/http/annotation/ExternalDocs.java | 86 +----------------
.../http/annotation/ExternalDocsAnnotation.java | 40 +-------
.../org/apache/juneau/http/annotation/Items.java | 103 +-------------------
.../juneau/http/annotation/ItemsAnnotation.java | 70 +-------------
.../org/apache/juneau/http/annotation/License.java | 84 +---------------
.../juneau/http/annotation/LicenseAnnotation.java | 38 --------
.../juneau/http/annotation/RequestAnnotation.java | 19 +---
.../http/annotation/ResponseStatusAnnotation.java | 17 +---
.../org/apache/juneau/http/annotation/Schema.java | 77 +--------------
.../juneau/http/annotation/SchemaAnnotation.java | 23 +----
.../apache/juneau/http/annotation/SubItems.java | 88 -----------------
.../juneau/http/annotation/SubItemsAnnotation.java | 72 +-------------
.../org/apache/juneau/http/annotation/Tag.java | 99 +------------------
.../juneau/http/annotation/TagAnnotation.java | 21 +---
.../org/apache/juneau/httppart/HttpPartSchema.java | 14 ++-
.../apache/juneau/json/JsonSchemaSerializer.java | 24 -----
.../juneau/jsonschema/JsonSchemaGenerator.java | 24 -----
.../juneau/rest/BasicSwaggerProviderSession.java | 52 +++-------
.../http/annotation/AnnotationUtils_Test.java | 7 --
.../http/annotation/ContactAnnotation_Test.java | 11 +--
.../http/annotation/LicenseAnnotation_Test.java | 11 +--
.../juneau/http/annotation/TagAnnotation_Test.java | 13 +--
.../juneau/httppart/HttpPartSchema_Body_Test.java | 6 +-
.../httppart/HttpPartSchema_FormData_Test.java | 6 +-
.../httppart/HttpPartSchema_Header_Test.java | 6 +-
.../juneau/httppart/HttpPartSchema_Path_Test.java | 6 +-
.../juneau/httppart/HttpPartSchema_Query_Test.java | 6 +-
.../HttpPartSchema_ResponseHeader_Test.java | 6 +-
.../httppart/HttpPartSchema_Response_Test.java | 6 +-
.../juneau/jsonschema/JsonSchemaGeneratorTest.java | 106 +--------------------
.../annotation/ExternalDocsAnnotation_Test.java | 11 +--
.../annotation/ItemsAnnotation_Test.java | 13 +--
.../annotation/SchemaAnnotation_Test.java | 9 +-
.../annotation/SubItemsAnnotation_Test.java | 11 +--
.../java/org/apache/juneau/rest/Swagger_Test.java | 20 ++--
.../rest/annotation/OpSwaggerAnnotation_Test.java | 2 +-
.../rest/annotation/ResponseHeader_Test.java | 8 +-
.../rest/annotation/RestAnnotation_Test.java | 2 +-
.../rest/annotation/RestDeleteAnnotation_Test.java | 2 +-
.../rest/annotation/RestGetAnnotation_Test.java | 2 +-
.../rest/annotation/RestOpAnnotation_Test.java | 2 +-
.../rest/annotation/RestPostAnnotation_Test.java | 2 +-
.../rest/annotation/RestPutAnnotation_Test.java | 2 +-
.../rest/annotation/SwaggerAnnotation_Test.java | 8 +-
.../juneau/rest/annotation/Swagger_Body_Test.java | 30 +++---
.../rest/annotation/Swagger_FormData_Test.java | 8 +-
.../rest/annotation/Swagger_Header_Test.java | 8 +-
.../juneau/rest/annotation/Swagger_Path_Test.java | 12 +--
.../juneau/rest/annotation/Swagger_Query_Test.java | 8 +-
.../rest/annotation/Swagger_Response_Test.java | 12 +--
54 files changed, 151 insertions(+), 1339 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
index 7448f45..f572865 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
@@ -19,8 +19,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
-import org.apache.juneau.collections.*;
-import org.apache.juneau.http.annotation.*;
import org.apache.juneau.http.header.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.json.*;
@@ -233,29 +231,6 @@ public final class HtmlSchemaDocSerializer extends
HtmlDocSerializer {
}
/**
- * <i><l>HtmlSchemaSerializer</l> configuration
property: </i> Default schemas.
- *
- * <p>
- * Allows you to override or provide custom schema information
for particular class types.
- * <p>
- * Keys are full class names.
- *
- * <ul class='seealso'>
- * <li class='jf'>{@link Schema#value}
- * </ul>
- *
- * @param c
- * The class to define a default schema for.
- * @param schema
- * The schema.
- * @return This object.
- */
- @FluentSetter
- public Builder defaultSchema(Class<?> c, OMap schema) {
- return
annotations(SchemaAnnotation.create(c).value(schema.toString()).build());
- }
-
- /**
* <i><l>HtmlSchemaSerializer</l> configuration
property: </i> Use bean definitions.
*
* <p>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
index d538f48..efc194f 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
@@ -22,7 +22,6 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
-import org.apache.juneau.http.annotation.*;
import org.apache.juneau.http.header.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.json.*;
@@ -300,29 +299,6 @@ public class HtmlSchemaSerializer extends HtmlSerializer {
}
/**
- * <i><l>HtmlSchemaSerializer</l> configuration
property: </i> Default schemas.
- *
- * <p>
- * Allows you to override or provide custom schema information
for particular class types.
- * <p>
- * Keys are full class names.
- *
- * <ul class='seealso'>
- * <li class='jf'>{@link Schema#value}
- * </ul>
- *
- * @param c
- * The class to define a default schema for.
- * @param schema
- * The schema.
- * @return This object.
- */
- @FluentSetter
- public Builder defaultSchema(Class<?> c, OMap schema) {
- return
annotations(SchemaAnnotation.create(c).value(schema.toString()).build());
- }
-
- /**
* <i><l>HtmlSchemaSerializer</l> configuration
property: </i> Use bean definitions.
*
* <p>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
index fb7850c..450faa2 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Contact.java
@@ -25,9 +25,8 @@ import java.lang.annotation.*;
* <p>
* Used to populate the auto-generated Swagger documentation and UI for
server-side <ja>@Rest</ja>-annotated classes.
*
- * <h5 class='section'>Examples:</h5>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
- * <jc>// Normal</jc>
* <ja>@Rest</ja>(
* swagger=<ja>@Swagger</ja>(
* contact=<ja>@Contact</ja>(
@@ -38,19 +37,6 @@ import java.lang.annotation.*;
* )
* )
* </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * contact=<ja>@Contact</ja>({
- * <js>"name:'Juneau Development Team',"</js>,
- * <js>"email:'[email protected]',"</js>,
- * <js>"url:'http://juneau.apache.org',"</js>,
- * <js>"x-extra:'extra field'"</js>
- * })
- * )
- * )
- * </p>
*
* <ul class='seealso'>
* <li class='link'>{@doc RestSwagger}
@@ -106,77 +92,4 @@ public @interface Contact {
* </ul>
*/
String url() default "";
-
- /**
- * Free-form value for the {@doc ExtSwaggerContactObject}.
- *
- * <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 contact information:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * contact=<ja>@Contact</ja>(
- * name=<js>"Juneau Development Team"</js>,
- * email=<js>"[email protected]"</js>,
- * url=<js>"http://juneau.apache.org"</js>
- * )
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * contact=<ja>@Contact</ja>({
- * <js>"name: 'Juneau Development
Team',"</js>,
- * <js>"email:
'[email protected]',"</js>,
- * <js>"url:
'http://juneau.apache.org'"</js>,
- * })
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- *
contact=<ja>@Contact</ja>(<js>"$L{contactSwagger}"</js>)
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>contactSwagger</mk> = <mv>{ name: "Juneau Development
Team", email: "[email protected]", url: "http://juneau.apache.org" }</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>
- *
- * <ul class='notes'>
- * <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>@Contact</ja>(<js>"{name: 'Juneau Development Team'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Contact</ja>(<js>"name: 'Juneau Development Team'"</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>) for the swagger generator.
- * <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[] value() default {};
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java
index 41e6f04..004bdf8 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java
@@ -12,12 +12,9 @@
//
***************************************************************************************************************************
package org.apache.juneau.http.annotation;
-import static org.apache.juneau.internal.ArrayUtils.*;
-
import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
-import org.apache.juneau.svl.*;
/**
* Utility classes and methods for the {@link Contact @Contact} annotation.
@@ -41,23 +38,6 @@ public class ContactAnnotation {
}
/**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static Contact copy(Contact a, VarResolverSession r) {
- return
- create()
- .email(r.resolve(a.email()))
- .name(r.resolve(a.name()))
- .url(r.resolve(a.url()))
- .value(r.resolve(a.value()))
- .build();
- }
-
- /**
* Returns <jk>true</jk> if the specified annotation contains all
default values.
*
* @param a The annotation to check.
@@ -81,7 +61,6 @@ public class ContactAnnotation {
public static class Builder extends AnnotationBuilder {
String email="", name="", url="";
- String[] value={};
/**
* Constructor.
@@ -133,17 +112,6 @@ public class ContactAnnotation {
return this;
}
- /**
- * Sets the {@link Contact#value} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
// <FluentSetters>
// </FluentSetters>
@@ -156,14 +124,12 @@ public class ContactAnnotation {
private static class Impl extends AnnotationImpl implements Contact {
private final String email, name, url;
- private final String[] value;
Impl(Builder b) {
super(b);
this.email = b.email;
this.name = b.name;
this.url = b.url;
- this.value = copyOf(b.value);
postConstruct();
}
@@ -181,10 +147,5 @@ public class ContactAnnotation {
public String url() {
return url;
}
-
- @Override /* Contact */
- public String[] value() {
- return value;
- }
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
index 5e5b8dc..cef5261 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocs.java
@@ -25,9 +25,8 @@ import java.lang.annotation.*;
* <p>
* Used to populate the auto-generated Swagger documentation and UI for
server-side <ja>@Rest</ja>-annotated classes.
*
- * <h5 class='section'>Examples:</h5>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
- * <jc>// Normal</jc>
* <ja>@Rest</ja>(
* swagger=<ja>@Swagger</ja>(
* externalDocs=<ja>@ExternalDocs</ja>(
@@ -37,17 +36,6 @@ import java.lang.annotation.*;
* )
* )
* </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * contact=<ja>@ExternalDocs</ja>({
- * <js>"description:'Apache Juneau',"</js>,
- * <js>"url:'http://juneau.apache.org'"</js>,
- * })
- * )
- * )
- * </p>
*
* <ul class='seealso'>
* <li class='link'>{@doc RestSwagger}
@@ -90,76 +78,4 @@ public @interface ExternalDocs {
* </ul>
*/
String url() default "";
-
- /**
- * Free-form value for the {@doc ExtSwaggerExternalDocumentationObject}.
- *
- * <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 documentation:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * externalDocs=<ja>@ExternalDocs</ja>(
- * description=<js>"Find out more about
Juneau"</js>,
- * url=<js>"http://juneau.apache.org"</js>
- * )
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * externalDocs=<ja>@ExternalDocs</ja>({
- * <js>"description: 'Find out more about
Juneau',"</js>,
- * <js>"url:
'http://juneau.apache.org'"</js>
- * })
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- *
externalDocs=<ja>@ExternalDocs</ja>(<js>"$L{externalDocsSwagger}"</js>)
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>externalDocsSwagger</mk> = <mv>{ description: "Find out
more about Juneau", url: "http://juneau.apache.org" }</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>
- *
- * <ul class='notes'>
- * <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>@ExternalDocs</ja>(<js>"{url:'http://juneau.apache.org'}"</js>)
- * </p>
- * <p class='bcode w800'>
- *
<ja>@ExternalDocs</ja>(<js>"url:'http://juneau.apache.org'"</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>) for the swagger generator.
- * <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[] value() default {};
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocsAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocsAnnotation.java
index 4863d74..1d2e8d6 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocsAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ExternalDocsAnnotation.java
@@ -20,7 +20,6 @@ import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
import org.apache.juneau.parser.*;
-import org.apache.juneau.svl.*;
/**
* Utility classes and methods for the {@link ExternalDocs @ExternalDocs}
annotation.
@@ -44,22 +43,6 @@ public class ExternalDocsAnnotation {
}
/**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static ExternalDocs copy(ExternalDocs a, VarResolverSession r) {
- return
- create()
- .description(r.resolve(a.description()))
- .url(r.resolve(a.url()))
- .value(r.resolve(a.value()))
- .build();
- }
-
- /**
* Returns <jk>true</jk> if the specified annotation contains all
default values.
*
* @param a The annotation to check.
@@ -80,8 +63,6 @@ public class ExternalDocsAnnotation {
public static OMap merge(OMap om, ExternalDocs a) throws ParseException
{
if (ExternalDocsAnnotation.empty(a))
return om;
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("description", joinnl(a.description()))
.appendSkipEmpty("url", a.url())
@@ -102,7 +83,7 @@ public class ExternalDocsAnnotation {
public static class Builder extends AnnotationBuilder {
String url="";
- String[] description={}, value={};
+ String[] description={};
/**
* Constructor.
@@ -142,17 +123,6 @@ public class ExternalDocsAnnotation {
return this;
}
- /**
- * Sets the {@link ExternalDocs#value} property on this
annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
// <FluentSetters>
// </FluentSetters>
}
@@ -164,13 +134,12 @@ public class ExternalDocsAnnotation {
private static class Impl extends AnnotationImpl implements
ExternalDocs {
private final String url;
- private final String[] description, value;
+ private final String[] description;
Impl(Builder b) {
super(b);
this.description = copyOf(b.description);
this.url = b.url;
- this.value = copyOf(b.value);
postConstruct();
}
@@ -183,10 +152,5 @@ public class ExternalDocsAnnotation {
public String url() {
return url;
}
-
- @Override
- public String[] value() {
- return value;
- }
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
index 8820a23..81578c4 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Items.java
@@ -43,19 +43,6 @@ import org.apache.juneau.oapi.*;
* )
* </p>
* <p class='bcode w800'>
- * <jc>// Same but defined free-form</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * collectionFormat=<js>"csv"</js>,
- * items=<ja>@Items</ja>({
- * <js>"type:'string',"</js>,
- * <js>"enum:'AVAILABLE,PENDING,SOLD',"</js>,
- * <js>"default:'AVAILABLE'"</js>
- * })
- * )
- * </p>
- * <p class='bcode w800'>
* <jc>// An array of arrays, the internal array being of type integer,
numbers must be between 0 and 63 (inclusive)</jc>
* <ja>@Query</ja>(
* name=<js>"status"</js>,
@@ -96,7 +83,7 @@ public @interface Items {
*
* <ul class='notes'>
* <li>
- * The format is a plain-text string.
+ * Each entry is a possible value. Can also contain
comma-delimited lists of values.
* </ul>
*/
String[] _enum() default {};
@@ -338,92 +325,4 @@ public @interface Items {
* </ul>
*/
boolean uniqueItems() default false;
-
- /**
- * Free-form value for the {@doc ExtSwaggerItemsObject}.
- *
- * <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 an Items object:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>(
- * type=<js>"string"</js>,
- * _enum=<js>"AVAILABLE,PENDING,SOLD"</js>,
- * _default=<js>"AVAILABLE"</js>
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>({
- * <js>"type: 'string'"</js>,
- * <js>"enum:
['AVAILABLE','PENDING','SOLD'],"</js>,
- * <js>"default: 'AVAILABLE'"</js>
- * })
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form as part of parent</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * api={
- * <js>"type:'array',"</js>,
- * <js>"items: {"</js>,
- * <js>"type: 'string',"</js>,
- * <js>"enum:
['AVAILABLE','PENDING','SOLD'],"</js>,
- * <js>"default: 'AVAILABLE'"</js>,
- * <js>"}"</js>)
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>(<js>"$L{statusItemsSwagger}"</js>)
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>statusItemsSwagger</mk> = <mv>{ type: "string", enum:
["AVAILABLE","PENDING","SOLD"], default: "AVAILABLE" }</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>
- *
- * <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>@Items</ja>(api=<js>"{type: 'string'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Items</ja>(api=<js>"type: 'string'"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <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[] value() default {};
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ItemsAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ItemsAnnotation.java
index 8ad851d..816d1e1 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ItemsAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ItemsAnnotation.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.internal.ArrayUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
-import org.apache.juneau.svl.*;
/**
* Utility classes and methods for the {@link Items @Items} annotation.
@@ -41,54 +40,6 @@ public class ItemsAnnotation {
}
/**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static Items copy(Items a, VarResolverSession r) {
- return
- create()
- ._default(r.resolve(a._default()))
- ._enum(r.resolve(a._enum()))
- .$ref(r.resolve(a.$ref()))
- .cf(r.resolve(a.cf()))
- .collectionFormat(r.resolve(a.collectionFormat()))
- .df(r.resolve(a.df()))
- .e(r.resolve(a.e()))
- .emax(a.emax())
- .emin(a.emin())
- .exclusiveMaximum(a.exclusiveMaximum())
- .exclusiveMinimum(a.exclusiveMinimum())
- .f(r.resolve(a.f()))
- .format(r.resolve(a.format()))
- .items(SubItemsAnnotation.copy(a.items(), r))
- .max(r.resolve(a.max()))
- .maxi(a.maxi())
- .maximum(r.resolve(a.maximum()))
- .maxItems(a.maxItems())
- .maxl(a.maxLength())
- .maxLength(a.maxLength())
- .min(r.resolve(a.min()))
- .mini(a.mini())
- .minimum(r.resolve(a.minimum()))
- .minItems(a.minItems())
- .minl(a.minl())
- .minLength(a.minLength())
- .mo(r.resolve(a.mo()))
- .multipleOf(r.resolve(a.mo()))
- .p(r.resolve(a.p()))
- .pattern(r.resolve(a.pattern()))
- .t(r.resolve(a.t()))
- .type(r.resolve(a.type()))
- .ui(a.ui())
- .uniqueItems(a.uniqueItems())
- .value(r.resolve(a.value()))
- .build();
- }
-
- /**
* Returns <jk>true</jk> if the specified annotation contains all
default values.
*
* @param a The annotation to check.
@@ -114,7 +65,7 @@ public class ItemsAnnotation {
boolean emax, emin, exclusiveMaximum, exclusiveMinimum, ui,
uniqueItems;
long maxItems=-1, maxLength=-1, maxi=-1, maxl=-1, minItems=-1,
minLength=-1, mini=-1, minl=-1;
String $ref="", cf="", collectionFormat="", f="", format="",
max="", maximum="", min="", minimum="", mo="", multipleOf="", p="", pattern="",
t="", type="";
- String[] _default={}, _enum={}, df={}, e={}, value={};
+ String[] _default={}, _enum={}, df={}, e={};
SubItems items = SubItemsAnnotation.DEFAULT;
/**
@@ -507,17 +458,6 @@ public class ItemsAnnotation {
return this;
}
- /**
- * Sets the {@link Items#value} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
// <FluentSetters>
// </FluentSetters>
}
@@ -531,7 +471,7 @@ public class ItemsAnnotation {
private final boolean emax, emin, exclusiveMaximum,
exclusiveMinimum, ui, uniqueItems;
private final long maxi, maxItems, maxl, maxLength, mini,
minItems, minl, minLength;
private final String $ref, cf, collectionFormat, f, format,
max, maximum, min, minimum, mo, multipleOf, p, pattern, t, type;
- private final String[] _default, _enum, df, e, value;
+ private final String[] _default, _enum, df, e;
private final SubItems items;
Impl(Builder b) {
@@ -570,7 +510,6 @@ public class ItemsAnnotation {
this.type = b.type;
this.ui = b.ui;
this.uniqueItems = b.uniqueItems;
- this.value = copyOf(b.value);
postConstruct();
}
@@ -743,10 +682,5 @@ public class ItemsAnnotation {
public boolean uniqueItems() {
return uniqueItems;
}
-
- @Override /* Items */
- public String[] value() {
- return value;
- }
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
index cb0e2c9..4b02570 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/License.java
@@ -25,9 +25,8 @@ import java.lang.annotation.*;
* <p>
* Used to populate the auto-generated Swagger documentation and UI for
server-side <ja>@Rest</ja>-annotated classes.
*
- * <h5 class='section'>Examples:</h5>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
- * <jc>// Normal</jc>
* <ja>@Rest</ja>(
* swagger=<ja>@Swagger</ja>(
* license=<ja>@License</ja>(
@@ -37,17 +36,6 @@ import java.lang.annotation.*;
* )
* )
* </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * license=<ja>@License</ja>({
- * <js>"name:'Apache 2.0',"</js>,
- *
<js>"url:'http://www.apache.org/licenses/LICENSE-2.0.html'"</js>
- * })
- * )
- * )
- * </p>
*
* <ul class='seealso'>
* <li class='link'>{@doc RestSwagger}
@@ -81,74 +69,4 @@ public @interface License {
* </ul>
*/
String url() default "";
-
- /**
- * Free-form value for the {@doc ExtSwaggerLicenseObject}.
- *
- * <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 license information:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * license=<ja>@License</ja>(
- * name=<js>"Apache 2.0"</js>,
- *
url=<js>"http://www.apache.org/licenses/LICENSE-2.0.html"</js>
- * )
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(
- * license=<ja>@License</ja>({
- * <js>"name: 'Apache 2.0',"</js>,
- * <js>"url:
'http://www.apache.org/licenses/LICENSE-2.0.html'"</js>
- * })
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>(<js>"$L{licenseSwagger}"</js>)
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>licenseSwagger</mk> = <mv>{ name: "Apache 2.0", url:
"http://www.apache.org/licenses/LICENSE-2.0.html" }</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>
- *
- * <ul class='notes'>
- * <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>@License</ja>(<js>"{name: 'Apache 2.0'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@License</ja>(<js>"name: 'Apache 2.0'"</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>) for the swagger generator.
- * <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[] value() default {};
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java
index cc4fe36..2fe98bf 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java
@@ -12,12 +12,9 @@
//
***************************************************************************************************************************
package org.apache.juneau.http.annotation;
-import static org.apache.juneau.internal.ArrayUtils.*;
-
import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
-import org.apache.juneau.svl.*;
/**
* Utility classes and methods for the {@link License @License} annotation.
@@ -41,22 +38,6 @@ public class LicenseAnnotation {
}
/**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static License copy(License a, VarResolverSession r) {
- return
- create()
- .name(r.resolve(a.name()))
- .url(r.resolve(a.url()))
- .value(r.resolve(a.value()))
- .build();
- }
-
- /**
* Returns <jk>true</jk> if the specified annotation contains all
default values.
*
* @param a The annotation to check.
@@ -80,7 +61,6 @@ public class LicenseAnnotation {
public static class Builder extends AnnotationBuilder {
String name="", url="";
- String[] value={};
/**
* Constructor.
@@ -121,17 +101,6 @@ public class LicenseAnnotation {
return this;
}
- /**
- * Sets the {@link License#value} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
// <FluentSetters>
// </FluentSetters>
@@ -144,13 +113,11 @@ public class LicenseAnnotation {
private static class Impl extends AnnotationImpl implements License {
private final String name, url;
- private final String[] value;
Impl(Builder b) {
super(b);
this.name = b.name;
this.url = b.url;
- this.value = copyOf(b.value);
postConstruct();
}
@@ -163,10 +130,5 @@ public class LicenseAnnotation {
public String url() {
return url;
}
-
- @Override /* License */
- public String[] value() {
- return value;
- }
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
index dcc6b8f..92a1404 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
@@ -63,23 +63,6 @@ public class RequestAnnotation {
return create().on(on);
}
- /**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static Request copy(Request a, VarResolverSession r) {
- return
- create()
- .on(r.resolve(a.on()))
- .onClass(a.onClass())
- .parser(a.parser())
- .serializer(a.serializer())
- .build();
- }
-
//-----------------------------------------------------------------------------------------------------------------
// Builder
//-----------------------------------------------------------------------------------------------------------------
@@ -209,7 +192,7 @@ public class RequestAnnotation {
if (isEmpty(a.on()) && isEmpty(a.onClass()))
return;
- b.annotations(copy(a, vr()));
+ b.annotations(a);
}
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java
index 46b39c4..ae2ca00 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java
@@ -63,21 +63,6 @@ public class ResponseStatusAnnotation {
return create().on(on);
}
- /**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static ResponseStatus copy(ResponseStatus a, VarResolverSession
r) {
- return
- create()
- .on(r.resolve(a.on()))
- .onClass(a.onClass())
- .build();
- }
-
//-----------------------------------------------------------------------------------------------------------------
// Builder
//-----------------------------------------------------------------------------------------------------------------
@@ -173,7 +158,7 @@ public class ResponseStatusAnnotation {
if (isEmpty(a.on()) && isEmpty(a.onClass()))
return;
- b.annotations(copy(a, vr()));
+ b.annotations(a);
}
}
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 a956f73..ae7d268 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
@@ -47,17 +47,7 @@ import org.apache.juneau.oapi.*;
* )
* </p>
* <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Response</ja>(
- * schema=<ja>@Schema</ja>({
- * <js>"type:'string',"</js>,
- * <js>"format:'binary'"</js>
- * })
- * )
- * </p>
- * <p class='bcode w800'>
* <jc>// A request body consisting of an array of arrays, the internal
array being of type integer, numbers must be between 0 and 63 (inclusive)</jc>
-</jc>
* <ja>@Body</ja>(
* schema=<ja>@Schema</ja>(
* items=<ja>@Items</ja>(
@@ -132,7 +122,7 @@ public @interface Schema {
* <br>On the server-side, this gets converted to a <c>BadRequest</c>
(400).
*
* <p>
- * The format is a {@doc SimplifiedJson} array or comma-delimited list.
+ * The format is either individual values or a comma-delimited list.
* <br>Multiple lines are concatenated with newlines.
*
* <h5 class='section'>Examples:</h5>
@@ -144,14 +134,6 @@ public @interface Schema {
* PetStatus <jv>status</jv>
* ) {...}
* </p>
- * <p class='bcode w800'>
- * <jc>// JSON array</jc>
- * <jk>public</jk> Collection<Pet> findPetsByStatus(
- * <ja>@Header</ja>(<js>"X-Status"</js>)
- *
<ja>@Schema</ja>(_enum=<js>"['AVAILABLE','PENDING','SOLD']"</js>)
- * PetStatus <jv>status</jv>
- * ) {...}
- * </p>
*
* <h5 class='section'>Used for:</h5>
* <ul class='spaced-list'>
@@ -1132,63 +1114,6 @@ public @interface Schema {
boolean uniqueItems() default false;
/**
- * Free-form value for the {@doc ExtSwaggerSchemaObject}.
- *
- * <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 a Schema object:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Schema</ja>(
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>(
- * $ref=<js>"#/definitions/Pet"</js>
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- *
<ja>@Schema</ja>(<js>"type:'array',items:{$ref:'#/definitions/Pet'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form using variables</jc>
- * <ja>@Schema</ja>(<js>"$L{petArraySwagger}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>petArraySwagger</mk> = <mv>{ type: "array", items: { $ref:
"#/definitions/Pet" } }</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>
- *
- * <ul class='notes'>
- * <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>@Schema</ja>(<js>"{type: 'array'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Schema</ja>(<js>"type: 'array'"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <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[] value() default {};
-
- /**
* <mk>xml</mk> field of the {@doc ExtSwaggerSchemaObject}.
*
* <ul class='notes'>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SchemaAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SchemaAnnotation.java
index 4052178..c542039 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SchemaAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SchemaAnnotation.java
@@ -91,8 +91,6 @@ public class SchemaAnnotation {
OMap om = new OMap();
if (SchemaAnnotation.empty(a))
return om;
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("additionalProperties",
parseMap(a.additionalProperties()))
.appendSkipEmpty("allOf", joinnl(a.allOf()))
@@ -131,8 +129,6 @@ public class SchemaAnnotation {
private static OMap merge(OMap om, Items a) throws ParseException {
if (ItemsAnnotation.empty(a))
return om;
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("collectionFormat",
a.collectionFormat(), a.cf())
.appendSkipEmpty("default", joinnl(a._default(),
a.df()))
@@ -797,17 +793,6 @@ public class SchemaAnnotation {
}
/**
- * Sets the {@link Schema#value} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
- /**
* Sets the {@link Schema#xml} property on this annotation.
*
* @param value The new value for this property.
@@ -864,7 +849,7 @@ public class SchemaAnnotation {
private final Items items;
private final long maxLength, maxl, minLength, minl, maxItems,
maxi, minItems, mini, maxProperties, maxp, minProperties, minp;
private final String $ref, format, f, title, multipleOf, mo,
maximum, max, minimum, min, pattern, p, type, t, collectionFormat, cf,
discriminator;
- private final String[] description, d, _default, df, _enum, e,
allOf, properties, additionalProperties, xml, value;
+ private final String[] description, d, _default, df, _enum, e,
allOf, properties, additionalProperties, xml;
Impl(Builder b) {
super(b);
@@ -923,7 +908,6 @@ public class SchemaAnnotation {
this.type = b.type;
this.ui = b.ui;
this.uniqueItems = b.uniqueItems;
- this.value = copyOf(b.value);
this.xml = copyOf(b.xml);
postConstruct();
}
@@ -1204,11 +1188,6 @@ public class SchemaAnnotation {
}
@Override /* Schema */
- public String[] value() {
- return value;
- }
-
- @Override /* Schema */
public String[] xml() {
return xml;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
index 446f0a4..8444277 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItems.java
@@ -296,92 +296,4 @@ public @interface SubItems {
* </ul>
*/
boolean uniqueItems() default false;
-
- /**
- * Free-form value for the {@doc ExtSwaggerItemsObject}.
- *
- * <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 an Items object:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>(
- * type=<js>"string"</js>,
- * _enum=<js>"AVAILABLE,PENDING,SOLD"</js>,
- * _default=<js>"AVAILABLE"</js>
- * )
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>({
- * <js>"type: 'string'"</js>,
- * <js>"enum:
['AVAILABLE','PENDING','SOLD'],"</js>,
- * <js>"default: 'AVAILABLE'"</js>
- * })
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form as part of parent</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * api={
- * <js>"type:'array',"</js>,
- * <js>"items: {"</js>,
- * <js>"type: 'string',"</js>,
- * <js>"enum:
['AVAILABLE','PENDING','SOLD'],"</js>,
- * <js>"default: 'AVAILABLE'"</js>,
- * <js>"}"</js>)
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Query</ja>(
- * name=<js>"status"</js>,
- * type=<js>"array"</js>,
- * items=<ja>@Items</ja>(<js>"$L{statusItemsSwagger}"</js>)
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>statusItemsSwagger</mk> = <mv>{ type: "string", enum:
["AVAILABLE","PENDING","SOLD"], default: "AVAILABLE" }</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>
- *
- * <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>@Items</ja>(api=<js>"{type: 'string'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Items</ja>(api=<js>"type: 'string'"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable.
- * <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[] value() default {};
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItemsAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItemsAnnotation.java
index a261c71..7a37b64 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItemsAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/SubItemsAnnotation.java
@@ -20,7 +20,6 @@ import java.lang.annotation.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
import org.apache.juneau.parser.*;
-import org.apache.juneau.svl.*;
/**
* Utility classes and methods for the {@link SubItems @SubItems} annotation.
@@ -44,54 +43,6 @@ public class SubItemsAnnotation {
}
/**
- * Creates a copy of the specified annotation.
- *
- * @param a The annotation to copy.
- * @param r The var resolver for resolving any variables.
- * @return A copy of the specified annotation.
- */
- public static SubItems copy(SubItems a, VarResolverSession r) {
- return
- create()
- ._default(r.resolve(a._default()))
- ._enum(r.resolve(a._enum()))
- .$ref(r.resolve(a.$ref()))
- .cf(r.resolve(a.cf()))
- .collectionFormat(r.resolve(a.collectionFormat()))
- .df(r.resolve(a.df()))
- .e(r.resolve(a.e()))
- .emax(a.emax())
- .emin(a.emin())
- .exclusiveMaximum(a.exclusiveMaximum())
- .exclusiveMinimum(a.exclusiveMinimum())
- .f(r.resolve(a.f()))
- .format(r.resolve(a.format()))
- .items(r.resolve(a.items()))
- .max(r.resolve(a.max()))
- .maxi(a.maxi())
- .maximum(r.resolve(a.maximum()))
- .maxItems(a.maxItems())
- .maxl(a.maxLength())
- .maxLength(a.maxLength())
- .min(r.resolve(a.min()))
- .mini(a.mini())
- .minimum(r.resolve(a.minimum()))
- .minItems(a.minItems())
- .minl(a.minl())
- .minLength(a.minLength())
- .mo(r.resolve(a.mo()))
- .multipleOf(r.resolve(a.mo()))
- .p(r.resolve(a.p()))
- .pattern(r.resolve(a.pattern()))
- .t(r.resolve(a.t()))
- .type(r.resolve(a.type()))
- .ui(a.ui())
- .uniqueItems(a.uniqueItems())
- .value(r.resolve(a.value()))
- .build();
- }
-
- /**
* Returns <jk>true</jk> if the specified annotation contains all
default values.
*
* @param a The annotation to check.
@@ -112,8 +63,6 @@ public class SubItemsAnnotation {
public static OMap merge(OMap om, SubItems a) throws ParseException {
if (SubItemsAnnotation.empty(a))
return om;
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("collectionFormat",
a.collectionFormat(), a.cf())
.appendSkipEmpty("default", joinnl(a._default(),
a.df()))
@@ -152,7 +101,7 @@ public class SubItemsAnnotation {
String $ref="", cf="", collectionFormat="", f="", format="",
max="", maximum="", min="", minimum="", mo="", multipleOf="", p="", pattern="",
t="", type="";
long maxItems=-1, maxLength=-1, maxi=-1, maxl=-1, minItems=-1,
minLength=-1, mini=-1, minl=-1;
boolean emax, emin, exclusiveMaximum, exclusiveMinimum, ui,
uniqueItems;
- String[] _default={}, _enum={}, df={}, e={}, items={}, value={};
+ String[] _default={}, _enum={}, df={}, e={}, items={};
/**
* Constructor.
@@ -544,17 +493,6 @@ public class SubItemsAnnotation {
return this;
}
- /**
- * Sets the <c>value</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
// <FluentSetters>
// </FluentSetters>
}
@@ -568,7 +506,7 @@ public class SubItemsAnnotation {
private final boolean emax, emin, exclusiveMaximum,
exclusiveMinimum, ui, uniqueItems;
private final long maxi, maxItems, maxl, maxLength, mini,
minItems, minl, minLength;
private final String $ref, cf, collectionFormat, f, format,
max, maximum, min, minimum, mo, multipleOf, p, pattern, t, type;
- private final String[] _default, _enum, df, e, items, value;
+ private final String[] _default, _enum, df, e, items;
Impl(Builder b) {
super(b);
@@ -606,7 +544,6 @@ public class SubItemsAnnotation {
this.type = b.type;
this.ui = b.ui;
this.uniqueItems = b.uniqueItems;
- this.value = copyOf(b.value);
postConstruct();
}
@@ -779,10 +716,5 @@ public class SubItemsAnnotation {
public boolean uniqueItems() {
return uniqueItems;
}
-
- @Override /* SubItems */
- public String[] value() {
- return value;
- }
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
index e645bb7..96f73ed 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Tag.java
@@ -26,7 +26,7 @@ import java.lang.annotation.*;
* <p>
* Used to populate the auto-generated Swagger documentation and UI for
server-side <ja>@Rest</ja>-annotated classes.
*
- * <h5 class='section'>Examples:</h5>
+ * <h5 class='section'>Example:</h5>
* <p class='bcode w800'>
* <jc>// A response object thats a hex-encoded string</jc>
* <ja>@Rest</ja>(
@@ -40,19 +40,6 @@ import java.lang.annotation.*;
* }
* )
* </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Rest</ja>(
- * swagger=<ja>@Swagger</ja>{
- * tags={
- * <ja>@Tag</ja>({
- * <js>"name:'utility',"</js>,
- * <js>"description:'Utility methods'"</js>
- * })
- * }
- * }
- * )
- * </p>
*
* <ul class='seealso'>
* <li class='link'>{@doc RestSwagger}
@@ -96,88 +83,4 @@ public @interface Tag {
* </ul>
*/
String name() default "";
-
- /**
- * Free-form value for the {@doc ExtSwaggerTagObject}.
- *
- * <p>
- * This is a {@doc SimplifiedJson} object that makes up the swagger
information for this Tag object.
- *
- * <p>
- * The following are completely equivalent ways of defining the swagger
description of the resource tags:
- * <p class='bcode w800'>
- * <jc>// Normal</jc>
- * <ja>@Swagger</ja>(
- * tags={
- * <ja>@Tag</ja>(
- * name=<js>"pet"</js>,
- * description=<js>"Everything about your
Pets"</js>,
- * externalDocs=<ja>@ExternalDocs</ja>(
- * description="<js>Find out
more"</js>,
- *
url=<js>"http://juneau.apache.org"</js>
- * }
- * )
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form</jc>
- * <ja>@Swagger</ja>(
- * tags={
- * <ja>@Tag</ja>(
- * name=<js>"pet"</js>,
- * api={
- * <js>"name: 'pet',"</js>,
- * <js>"description: 'Everything
about your Pets',"</js>,
- * <js>"externalDocs: {"</js>,
- * <js>"description: 'Find
out more',"</js>,
- * <js>"url:
'http://juneau.apache.org'"</js>
- * <js>"}"</js>
- * }
- * )
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <jc>// Free-form with variables</jc>
- * <ja>@Swagger</ja>(
- * tags={
- * <ja>@Tag</ja>(
- * name=<js>"pet"</js>,
- * api=<js>"$L{petTagSwagger}"</js>
- * )
- * }
- * )
- * </p>
- * <p class='bcode w800'>
- * <mc>// Contents of MyResource.properties</mc>
- * <mk>petTagSwagger</mk> = <mv>{ name: "pet", description:
"Everything about your Pets", externalDocs: { description: "Find out more",
url: "http://juneau.apache.org" } }</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>
- *
- * <ul class='notes'>
- * <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>@Tag</ja>(api=<js>"{description: 'Everything about your
Pets'}"</js>)
- * </p>
- * <p class='bcode w800'>
- * <ja>@Tag</ja>(api=<js>"description: 'Everything about your
Pets'"</js>)
- * </p>
- * <li>
- * Multiple lines are concatenated with newlines so that
you can format the value to be readable:
- * <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[] value() default {};
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java
index 4b0f630..ccfbceb 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java
@@ -54,7 +54,7 @@ public class TagAnnotation {
ExternalDocs externalDocs = ExternalDocsAnnotation.DEFAULT;
String name="";
- String[] description={}, value={};
+ String[] description={};
/**
* Constructor.
@@ -105,17 +105,6 @@ public class TagAnnotation {
return this;
}
- /**
- * Sets the {@link Tag#value} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String...value) {
- this.value = value;
- return this;
- }
-
// <FluentSetters>
// </FluentSetters>
@@ -129,14 +118,13 @@ public class TagAnnotation {
private final ExternalDocs externalDocs;
private final String name;
- private final String[] description, value;
+ private final String[] description;
Impl(Builder b) {
super(b);
this.description = copyOf(b.description);
this.externalDocs = b.externalDocs;
this.name = b.name;
- this.value = copyOf(b.value);
postConstruct();
}
@@ -154,10 +142,5 @@ public class TagAnnotation {
public String name() {
return name;
}
-
- @Override /* Tag */
- public String[] value() {
- return value;
- }
}
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
index 871b628..3f4de03 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
@@ -4056,10 +4056,18 @@ public class HttpPartSchema {
}
final static Set<String> toSet(String[]...s) {
+ boolean isNotEmpty = false;
for (String[] ss : s)
- if (ss != null && ss.length > 0)
- return toSet(joinnl(ss));
- return null;
+ isNotEmpty |= ss.length > 0;
+ if (! isNotEmpty)
+ return null;
+ Set<String> set = ASet.of();
+ for (String[] ss : s)
+ if (ss != null)
+ for (String ss2 : ss)
+ for (String ss3 : split(ss2, ','))
+ set.add(trim(ss3));
+ return set.isEmpty() ? null : set;
}
final static Set<String> toSet(String s) {
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
index 1c682b9..43a18c9 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
@@ -23,7 +23,6 @@ import java.util.concurrent.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
-import org.apache.juneau.http.annotation.*;
import org.apache.juneau.http.header.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.jsonschema.*;
@@ -292,29 +291,6 @@ public class JsonSchemaSerializer extends JsonSerializer
implements JsonSchemaMe
}
/**
- * <i><l>JsonSchemaSerializer</l> configuration
property: </i> Default schemas.
- *
- * <p>
- * Allows you to override or provide custom schema information
for particular class types.
- * <p>
- * Keys are full class names.
- *
- * <ul class='seealso'>
- * <li class='jf'>{@link Schema#value}
- * </ul>
- *
- * @param c
- * The class to define a default schema for.
- * @param schema
- * The schema.
- * @return This object.
- */
- @FluentSetter
- public Builder defaultSchema(Class<?> c, OMap schema) {
- return
annotations(SchemaAnnotation.create(c).value(schema.toString()).build());
- }
-
- /**
* <i><l>JsonSchemaSerializer</l> configuration
property: </i> Use bean definitions.
*
* <p>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
index d3d6827..7977955 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
@@ -27,7 +27,6 @@ import java.util.regex.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
-import org.apache.juneau.http.annotation.*;
import org.apache.juneau.http.header.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.json.*;
@@ -310,29 +309,6 @@ public class JsonSchemaGenerator extends
BeanTraverseContext implements JsonSche
}
/**
- * Default schemas.
- *
- * <p>
- * Allows you to override or provide custom schema information
for particular class types.
- * <p>
- * Keys are full class names.
- *
- * <ul class='seealso'>
- * <li class='jf'>{@link Schema#value}
- * </ul>
- *
- * @param c
- * The class to define a default schema for.
- * @param schema
- * The schema.
- * @return This object.
- */
- @FluentSetter
- public Builder defaultSchema(Class<?> c, OMap schema) {
- return
annotations(SchemaAnnotation.create(c.getName()).value(schema.toString()).build());
- }
-
- /**
* Ignore types from schema definitions.
*
* <h5 class='section'>Description:</h5>
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 e709ea2..e802703 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
@@ -708,15 +708,6 @@ public class BasicSwaggerProviderSession {
}
}
- private OMap newMap(OMap om, String[] value, String location,
Object...locationArgs) throws ParseException {
- if (value.length == 0)
- return om == null ? new OMap() : om;
- OMap om2 = parseMap(joinnl(value), location,
locationArgs);
- if (om == null)
- return om2;
- return om.append(om2);
- }
-
private OMap merge(OMap...maps) {
OMap m = maps[0];
for (int i = 1; i < maps.length; i++) {
@@ -749,36 +740,36 @@ public class BasicSwaggerProviderSession {
return null;
}
- private OMap toMap(ExternalDocs a, String location,
Object...locationArgs) throws ParseException {
+ private OMap toMap(ExternalDocs a, String location,
Object...locationArgs) {
if (ExternalDocsAnnotation.empty(a))
return null;
- OMap om = newMap(new OMap(), a.value(), location, locationArgs)
+ OMap om = OMap.create()
.appendSkipEmpty("description",
resolve(joinnl(a.description())))
.appendSkipEmpty("url", resolve(a.url()));
return nullIfEmpty(om);
}
- private OMap toMap(Contact a, String location, Object...locationArgs)
throws ParseException {
+ private OMap toMap(Contact a, String location, Object...locationArgs) {
if (ContactAnnotation.empty(a))
return null;
- OMap om = newMap(new OMap(), a.value(), location, locationArgs)
+ OMap om = OMap.create()
.appendSkipEmpty("name", resolve(a.name()))
.appendSkipEmpty("url", resolve(a.url()))
.appendSkipEmpty("email", resolve(a.email()));
return nullIfEmpty(om);
}
- private OMap toMap(License a, String location, Object...locationArgs)
throws ParseException {
+ private OMap toMap(License a, String location, Object...locationArgs) {
if (LicenseAnnotation.empty(a))
return null;
- OMap om = newMap(new OMap(), a.value(), location, locationArgs)
+ OMap om = OMap.create()
.appendSkipEmpty("name", resolve(a.name()))
.appendSkipEmpty("url", resolve(a.url()));
return nullIfEmpty(om);
}
- private OMap toMap(Tag a, String location, Object...locationArgs)
throws ParseException {
- OMap om = newMap(new OMap(), a.value(), location, locationArgs);
+ private OMap toMap(Tag a, String location, Object...locationArgs) {
+ OMap om = OMap.create();
om
.appendSkipEmpty("name", resolve(a.name()))
.appendSkipEmpty("description",
resolve(joinnl(a.description())))
@@ -786,7 +777,7 @@ public class BasicSwaggerProviderSession {
return nullIfEmpty(om);
}
- private OList toList(Tag[] aa, String location, Object...locationArgs)
throws ParseException {
+ private OList toList(Tag[] aa, String location, Object...locationArgs) {
if (aa.length == 0)
return null;
OList ol = new OList();
@@ -1000,8 +991,6 @@ public class BasicSwaggerProviderSession {
if (SchemaAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("additionalProperties",
toOMap(a.additionalProperties()))
.appendSkipEmpty("allOf", joinnl(a.allOf()))
@@ -1037,12 +1026,10 @@ public class BasicSwaggerProviderSession {
;
}
- private OMap merge(OMap om, ExternalDocs a) throws ParseException {
+ private OMap merge(OMap om, ExternalDocs a) {
if (ExternalDocsAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("description",
resolve(a.description()))
.appendSkipEmpty("url", a.url())
@@ -1053,8 +1040,6 @@ public class BasicSwaggerProviderSession {
if (ItemsAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("collectionFormat",
a.collectionFormat(), a.cf())
.appendSkipEmpty("default", joinnl(a._default(),
a.df()))
@@ -1081,8 +1066,6 @@ public class BasicSwaggerProviderSession {
if (SubItemsAnnotation.empty(a))
return om;
om = newMap(om);
- if (a.value().length > 0)
- om.putAll(parseMap(a.value()));
return om
.appendSkipEmpty("collectionFormat",
a.collectionFormat(), a.cf())
.appendSkipEmpty("default", joinnl(a._default(),
a.df()))
@@ -1175,8 +1158,6 @@ public class BasicSwaggerProviderSession {
return param;
}
-
-
private OMap toOMap(String[] ss) throws ParseException {
if (ss.length == 0)
return null;
@@ -1189,17 +1170,14 @@ public class BasicSwaggerProviderSession {
return OMap.ofJson(s);
}
- private Set<String> toSet(String[] ss) throws ParseException {
+ private Set<String> toSet(String[] ss) {
if (ss.length == 0)
return null;
- String s = joinnl(ss);
- if (s.isEmpty())
- return null;
- s = resolve(s);
Set<String> set = ASet.of();
- for (Object o : StringUtils.parseListOrCdl(s))
- set.add(o.toString());
- return set;
+ for (String s : ss)
+ for (String s2 : split(s, ','))
+ set.add(trim(s2));
+ return set.isEmpty() ? null : set;
}
static String joinnl(String[]...s) {
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 3fa6436..8d7d742 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
@@ -81,7 +81,6 @@ public class AnnotationUtils_Test {
assertFalse(ContactAnnotation.empty(contact().email("foo").build()));
assertFalse(ContactAnnotation.empty(contact().name("foo").build()));
assertFalse(ContactAnnotation.empty(contact().url("foo").build()));
-
assertFalse(ContactAnnotation.empty(contact().value(a("foo")).build()));
}
@Test
@@ -180,7 +179,6 @@ public class AnnotationUtils_Test {
assertFalse(LicenseAnnotation.empty(license().name("foo").build()));
assertFalse(LicenseAnnotation.empty(license().url("foo").build()));
-
assertFalse(LicenseAnnotation.empty(license().value(a("foo")).build()));
}
@Test
@@ -269,7 +267,6 @@ public class AnnotationUtils_Test {
assertObject(tag().description(a("foo")).build().description()).asJson().is("['foo']");
assertObject(tag().externalDocs(externalDocs().url("foo").build()).build().externalDocs().url()).asJson().is("'foo'");
assertObject(tag().name("foo").build().name()).asJson().is("'foo'");
-
assertObject(tag().value(a("foo")).build().value()).asJson().is("['foo']");
}
@Test
@@ -283,7 +280,6 @@ public class AnnotationUtils_Test {
assertFalse(ExternalDocsAnnotation.empty(externalDocs().description(a("foo")).build()));
assertFalse(ExternalDocsAnnotation.empty(externalDocs().url("foo").build()));
-
assertFalse(ExternalDocsAnnotation.empty(externalDocs().value(a("foo")).build()));
}
@Test
@@ -346,7 +342,6 @@ public class AnnotationUtils_Test {
assertFalse(SchemaAnnotation.empty(schema().type("foo").build()));
assertFalse(SchemaAnnotation.empty(schema().ui(true).build()));
assertFalse(SchemaAnnotation.empty(schema().uniqueItems(true).build()));
-
assertFalse(SchemaAnnotation.empty(schema().value(a("foo")).build()));
assertFalse(SchemaAnnotation.empty(schema().xml(a("foo")).build()));
}
@@ -393,7 +388,6 @@ public class AnnotationUtils_Test {
assertFalse(SubItemsAnnotation.empty(subItems().type("foo").build()));
assertFalse(SubItemsAnnotation.empty(subItems().ui(true).build()));
assertFalse(SubItemsAnnotation.empty(subItems().uniqueItems(true).build()));
-
assertFalse(SubItemsAnnotation.empty(subItems().value(a("foo")).build()));
}
@Test
@@ -438,7 +432,6 @@ public class AnnotationUtils_Test {
assertFalse(ItemsAnnotation.empty(items().type("foo").build()));
assertFalse(ItemsAnnotation.empty(items().ui(true).build()));
assertFalse(ItemsAnnotation.empty(items().uniqueItems(true).build()));
-
assertFalse(ItemsAnnotation.empty(items().value(a("foo")).build()));
}
//-----------------------------------------------------------------------------------------------------------------
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ContactAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ContactAnnotation_Test.java
index 90db001..e86ca7b 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ContactAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/ContactAnnotation_Test.java
@@ -30,14 +30,12 @@ public class ContactAnnotation_Test {
.email("email")
.name("name")
.url("url")
- .value("value")
.build();
Contact a2 = ContactAnnotation.create()
.email("email")
.name("name")
.url("url")
- .value("value")
.build();
@Test
@@ -46,8 +44,7 @@ public class ContactAnnotation_Test {
+ "{"
+ "email:'email',"
+ "name:'name',"
- + "url:'url',"
- + "value:['value']"
+ + "url:'url'"
+ "}"
);
}
@@ -76,8 +73,7 @@ public class ContactAnnotation_Test {
@Contact(
email="email",
name="name",
- url="url",
- value="value"
+ url="url"
)
public static class D1 {}
Contact d1 = D1.class.getAnnotationsByType(Contact.class)[0];
@@ -85,8 +81,7 @@ public class ContactAnnotation_Test {
@Contact(
email="email",
name="name",
- url="url",
- value="value"
+ url="url"
)
public static class D2 {}
Contact d2 = D2.class.getAnnotationsByType(Contact.class)[0];
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/LicenseAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/LicenseAnnotation_Test.java
index 7b01f01..f0018c2 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/LicenseAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/LicenseAnnotation_Test.java
@@ -29,13 +29,11 @@ public class LicenseAnnotation_Test {
License a1 = LicenseAnnotation.create()
.name("name")
.url("url")
- .value("value")
.build();
License a2 = LicenseAnnotation.create()
.name("name")
.url("url")
- .value("value")
.build();
@Test
@@ -43,8 +41,7 @@ public class LicenseAnnotation_Test {
assertObject(a1).asJson().is(""
+ "{"
+ "name:'name',"
- + "url:'url',"
- + "value:['value']"
+ + "url:'url'"
+ "}"
);
}
@@ -76,16 +73,14 @@ public class LicenseAnnotation_Test {
@License(
name="name",
- url="url",
- value="value"
+ url="url"
)
public static class D1 {}
License d1 = D1.class.getAnnotationsByType(License.class)[0];
@License(
name="name",
- url="url",
- value="value"
+ url="url"
)
public static class D2 {}
License d2 = D2.class.getAnnotationsByType(License.class)[0];
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/TagAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/TagAnnotation_Test.java
index 2e5b235..643a2ed 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/annotation/TagAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/annotation/TagAnnotation_Test.java
@@ -30,14 +30,12 @@ public class TagAnnotation_Test {
.description("description")
.externalDocs(ExternalDocsAnnotation.DEFAULT)
.name("name")
- .value("value")
.build();
Tag a2 = TagAnnotation.create()
.description("description")
.externalDocs(ExternalDocsAnnotation.DEFAULT)
.name("name")
- .value("value")
.build();
@Test
@@ -45,9 +43,8 @@ public class TagAnnotation_Test {
assertObject(a1).asJson().is(""
+ "{"
+ "description:['description'],"
- +
"externalDocs:{description:[],url:'',value:[]},"
- + "name:'name',"
- + "value:['value']"
+ + "externalDocs:{description:[],url:''},"
+ + "name:'name'"
+ "}"
);
}
@@ -80,8 +77,7 @@ public class TagAnnotation_Test {
@Tag(
description="description",
externalDocs=@ExternalDocs,
- name="name",
- value="value"
+ name="name"
)
public static class D1 {}
Tag d1 = D1.class.getAnnotationsByType(Tag.class)[0];
@@ -89,8 +85,7 @@ public class TagAnnotation_Test {
@Tag(
description="description",
externalDocs=@ExternalDocs,
- name="name",
- value="value"
+ name="name"
)
public static class D2 {}
Tag d2 = D2.class.getAnnotationsByType(Tag.class)[0];
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 da2b24b..9d87c1c 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
@@ -388,7 +388,7 @@ public class HttpPartSchema_Body_Test {
@Body
@Schema(
- e="['X','Y']"
+ e="X,Y"
)
public static class B04c {}
@@ -404,9 +404,9 @@ public class HttpPartSchema_Body_Test {
@Body
@Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
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 b35e390..a751b65 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
@@ -505,7 +505,7 @@ public class HttpPartSchema_FormData_Test {
}
@FormData
- @Schema(e="['X','Y']")
+ @Schema(e="X,Y")
public static class B04c {}
@Test
@@ -520,9 +520,9 @@ public class HttpPartSchema_FormData_Test {
@FormData
@Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
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 9e59986..967e5f4 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
@@ -482,7 +482,7 @@ public class HttpPartSchema_Header_Test {
assertThrown(()->s.validateInput("Z")).message().is("Value does
not match one of the expected values. Must be one of the following: X, Y");
}
- @Header @Schema(e="['X','Y']")
+ @Header @Schema(e="X,Y")
public static class B04c {}
@Test
@@ -496,9 +496,9 @@ public class HttpPartSchema_Header_Test {
@Header @Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
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 d1663b8..a707357 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
@@ -437,7 +437,7 @@ public class HttpPartSchema_Path_Test {
assertThrown(()->s.validateInput("Z")).message().is("Value does
not match one of the expected values. Must be one of the following: X, Y");
}
- @Path @Schema(e="['X','Y']")
+ @Path @Schema(e="X,Y")
public static class B04c {}
@Test
@@ -452,9 +452,9 @@ public class HttpPartSchema_Path_Test {
@Path
@Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
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 9150f6a..e3b49d1 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
@@ -510,7 +510,7 @@ public class HttpPartSchema_Query_Test {
assertThrown(()->s.validateInput("Z")).message().is("Value does
not match one of the expected values. Must be one of the following: X, Y");
}
- @Query @Schema(e="['X','Y']")
+ @Query @Schema(e="X,Y")
public static class B04c {}
@Test
@@ -525,9 +525,9 @@ public class HttpPartSchema_Query_Test {
@Query
@Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
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 f32a5e6..012c7a3 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
@@ -461,7 +461,7 @@ public class HttpPartSchema_ResponseHeader_Test {
assertThrown(()->s.validateInput("Z")).message().is("Value does
not match one of the expected values. Must be one of the following: X, Y");
}
- @ResponseHeader @Schema(e="['X','Y']")
+ @ResponseHeader @Schema(e="X,Y")
public static class B04c {}
@Test
@@ -475,9 +475,9 @@ public class HttpPartSchema_ResponseHeader_Test {
@ResponseHeader @Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Response_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Response_Test.java
index 1fdaa10..fa3a20b 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Response_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchema_Response_Test.java
@@ -318,7 +318,7 @@ public class HttpPartSchema_Response_Test {
assertThrown(()->s.validateInput("Z")).message().is("Value does
not match one of the expected values. Must be one of the following: X, Y");
}
- @Response(schema=@Schema(e="['X','Y']"))
+ @Response(schema=@Schema(e="X,Y"))
public static class B04c {}
@Test
@@ -333,9 +333,9 @@ public class HttpPartSchema_Response_Test {
@Response(
schema=@Schema(
items=@Items(
- e="['W']",
+ e="W",
items=@SubItems(
- e="['X']",
+ e="X",
items={
"enum:['Y'],",
"items:{enum:['Z']}"
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/JsonSchemaGeneratorTest.java
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/JsonSchemaGeneratorTest.java
index 3ad99d1..ae2b13f 100755
---
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/JsonSchemaGeneratorTest.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/JsonSchemaGeneratorTest.java
@@ -1205,108 +1205,6 @@ public class JsonSchemaGeneratorTest {
}
//====================================================================================================
- // JSONSCHEMA_defaultSchemas
-
//====================================================================================================
-
- // If default schema contains 'type', it's considered complete.
- @Test
- public void defaultSchemas() throws Exception {
- JsonSchemaGeneratorSession s =
JsonSchemaGenerator.DEFAULT.copy()
- .defaultSchema(SimpleBean.class, OMap.of("type", "bar"))
- .defaultSchema(BeanMap.class, OMap.of("type", "bar"))
- .defaultSchema(BeanList.class, OMap.of("type", "bar"))
- .defaultSchema(BeanList[][].class, OMap.of("type",
"bar"))
- .defaultSchema(boolean.class, OMap.of("type", "bar"))
- .defaultSchema(Boolean.class, OMap.of("type", "bar"))
- .defaultSchema(short.class, OMap.of("type", "bar"))
- .defaultSchema(Short.class, OMap.of("type", "bar"))
- .defaultSchema(int.class, OMap.of("type", "bar"))
- .defaultSchema(Integer.class, OMap.of("type", "bar"))
- .defaultSchema(long.class, OMap.of("type", "bar"))
- .defaultSchema(Long.class, OMap.of("type", "bar"))
- .defaultSchema(float.class, OMap.of("type", "bar"))
- .defaultSchema(Float.class, OMap.of("type", "bar"))
- .defaultSchema(double.class, OMap.of("type", "bar"))
- .defaultSchema(Double.class, OMap.of("type", "bar"))
- .defaultSchema(String.class, OMap.of("type", "bar"))
- .defaultSchema(StringBuilder.class, OMap.of("type",
"bar"))
- .defaultSchema(Character.class, OMap.of("type", "bar"))
- .defaultSchema(char.class, OMap.of("type", "bar"))
- .defaultSchema(TestEnumToString.class, OMap.of("type",
"bar"))
- .build().getSession();
-
assertObject(s.getSchema(SimpleBean.class)).asJson().contains("type:'bar'}");
-
assertObject(s.getSchema(BeanMap.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(BeanList.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(BeanList[][].class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(boolean.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Boolean.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(short.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Short.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(int.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Integer.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(long.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Long.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(float.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Float.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(double.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Double.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(String.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(StringBuilder.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(Character.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(char.class)).asJson().contains("type:'bar'");
-
assertObject(s.getSchema(TestEnumToString.class)).asJson().contains("type:'bar'");
- }
-
- // If default schema does not contain 'type', the value is augmented
- @Test
- public void defaultSchemasNoType() throws Exception {
- JsonSchemaGeneratorSession s =
JsonSchemaGenerator.DEFAULT.copy()
- .defaultSchema(SimpleBean.class, OMap.of("foo", "bar"))
- .defaultSchema(BeanMap.class, OMap.of("foo", "bar"))
- .defaultSchema(BeanList.class, OMap.of("foo", "bar"))
- .defaultSchema(BeanList[][].class, OMap.of("foo",
"bar"))
- .defaultSchema(boolean.class, OMap.of("foo", "bar"))
- .defaultSchema(Boolean.class, OMap.of("foo", "bar"))
- .defaultSchema(short.class, OMap.of("foo", "bar"))
- .defaultSchema(Short.class, OMap.of("foo", "bar"))
- .defaultSchema(int.class, OMap.of("foo", "bar"))
- .defaultSchema(Integer.class, OMap.of("foo", "bar"))
- .defaultSchema(long.class, OMap.of("foo", "bar"))
- .defaultSchema(Long.class, OMap.of("foo", "bar"))
- .defaultSchema(float.class, OMap.of("foo", "bar"))
- .defaultSchema(Float.class, OMap.of("foo", "bar"))
- .defaultSchema(double.class, OMap.of("foo", "bar"))
- .defaultSchema(Double.class, OMap.of("foo", "bar"))
- .defaultSchema(String.class, OMap.of("foo", "bar"))
- .defaultSchema(StringBuilder.class, OMap.of("foo",
"bar"))
- .defaultSchema(Character.class, OMap.of("foo", "bar"))
- .defaultSchema(char.class, OMap.of("foo", "bar"))
- .defaultSchema(TestEnumToString.class, OMap.of("foo",
"bar"))
- .build().getSession();
-
assertObject(s.getSchema(SimpleBean.class)).asJson().is("{foo:'bar',type:'object',properties:{f1:{foo:'bar',type:'string'}}}");
-
assertObject(s.getSchema(BeanMap.class)).asJson().is("{foo:'bar',type:'object',additionalProperties:{foo:'bar',type:'object',properties:{f1:{foo:'bar',type:'string'}}}}");
-
assertObject(s.getSchema(BeanList.class)).asJson().is("{foo:'bar',type:'array',items:{foo:'bar',type:'object',properties:{f1:{foo:'bar',type:'string'}}}}");
-
assertObject(s.getSchema(BeanList[][].class)).asJson().is("{foo:'bar',type:'array',items:{type:'array',items:{foo:'bar',type:'array',items:{foo:'bar',type:'object',properties:{f1:{foo:'bar',type:'string'}}}}}}");
-
assertObject(s.getSchema(boolean.class)).asJson().is("{foo:'bar',type:'boolean'}");
-
assertObject(s.getSchema(Boolean.class)).asJson().is("{foo:'bar',type:'boolean'}");
-
assertObject(s.getSchema(short.class)).asJson().is("{foo:'bar',type:'integer',format:'int16'}");
-
assertObject(s.getSchema(Short.class)).asJson().is("{foo:'bar',type:'integer',format:'int16'}");
-
assertObject(s.getSchema(int.class)).asJson().is("{foo:'bar',type:'integer',format:'int32'}");
-
assertObject(s.getSchema(Integer.class)).asJson().is("{foo:'bar',type:'integer',format:'int32'}");
-
assertObject(s.getSchema(long.class)).asJson().is("{foo:'bar',type:'integer',format:'int64'}");
-
assertObject(s.getSchema(Long.class)).asJson().is("{foo:'bar',type:'integer',format:'int64'}");
-
assertObject(s.getSchema(float.class)).asJson().is("{foo:'bar',type:'number',format:'float'}");
-
assertObject(s.getSchema(Float.class)).asJson().is("{foo:'bar',type:'number',format:'float'}");
-
assertObject(s.getSchema(double.class)).asJson().is("{foo:'bar',type:'number',format:'double'}");
-
assertObject(s.getSchema(Double.class)).asJson().is("{foo:'bar',type:'number',format:'double'}");
-
assertObject(s.getSchema(String.class)).asJson().is("{foo:'bar',type:'string'}");
-
assertObject(s.getSchema(StringBuilder.class)).asJson().is("{foo:'bar',type:'string'}");
-
assertObject(s.getSchema(Character.class)).asJson().is("{foo:'bar',type:'string'}");
-
assertObject(s.getSchema(char.class)).asJson().is("{foo:'bar',type:'string'}");
-
assertObject(s.getSchema(TestEnumToString.class)).asJson().is("{foo:'bar',type:'string','enum':['one','two','three']}");
- }
-
-
//====================================================================================================
// JSONSCHEMA_allowNestedExamples
//====================================================================================================
@@ -1522,7 +1420,7 @@ public class JsonSchemaGeneratorTest {
// @JsonSchema on ObjectSwap
//====================================================================================================
- @Schema(onClass=B.class,value="{foo:'bar'}")
+ @Schema(onClass=B.class,$ref="ref")
static class BConfig {}
static class B {}
@@ -1532,7 +1430,7 @@ public class JsonSchemaGeneratorTest {
public void schemaOnClass_onConfig() throws Exception {
AnnotationWorkList al =
bConfig.getAnnotationList().getWork(null);
JsonSchemaGeneratorSession x =
JsonSchemaGenerator.create().apply(al).build().getSession();
- assertObject(x.getSchema(new
B())).asJson().contains("foo:'bar'");
+ assertObject(x.getSchema(new
B())).asJson().contains("'$ref':'ref'");
}
}
\ No newline at end of file
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ExternalDocsAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ExternalDocsAnnotation_Test.java
index 9a22439..45af0b2 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ExternalDocsAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ExternalDocsAnnotation_Test.java
@@ -30,13 +30,11 @@ public class ExternalDocsAnnotation_Test {
ExternalDocs a1 = ExternalDocsAnnotation.create()
.description("description")
.url("url")
- .value("value")
.build();
ExternalDocs a2 = ExternalDocsAnnotation.create()
.description("description")
.url("url")
- .value("value")
.build();
@Test
@@ -44,8 +42,7 @@ public class ExternalDocsAnnotation_Test {
assertObject(a1).asString().is(""
+ "{"
+ "description:['description'],"
- + "url:'url',"
- + "value:['value']"
+ + "url:'url'"
+ "}"
);
}
@@ -77,16 +74,14 @@ public class ExternalDocsAnnotation_Test {
@ExternalDocs(
description="description",
- url="url",
- value="value"
+ url="url"
)
public static class D1 {}
ExternalDocs d1 = D1.class.getAnnotationsByType(ExternalDocs.class)[0];
@ExternalDocs(
description="description",
- url="url",
- value="value"
+ url="url"
)
public static class D2 {}
ExternalDocs d2 = D2.class.getAnnotationsByType(ExternalDocs.class)[0];
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ItemsAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ItemsAnnotation_Test.java
index 7d63389..c6ebf60 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ItemsAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/ItemsAnnotation_Test.java
@@ -61,7 +61,6 @@ public class ItemsAnnotation_Test {
.type("type")
.ui(true)
.uniqueItems(true)
- .value("value")
.build();
Items a2 = ItemsAnnotation.create()
@@ -98,7 +97,6 @@ public class ItemsAnnotation_Test {
.type("type")
.ui(true)
.uniqueItems(true)
- .value("value")
.build();
@Test
@@ -118,7 +116,7 @@ public class ItemsAnnotation_Test {
+ "exclusiveMinimum:true,"
+ "f:'f',"
+ "format:'format',"
- +
"items:{'$ref':'',_default:[],_enum:[],cf:'',collectionFormat:'',df:[],e:[],emax:false,emin:false,exclusiveMaximum:false,exclusiveMinimum:false,f:'',format:'',items:[],max:'',maxItems:-1,maxLength:-1,maxi:-1,maximum:'',maxl:-1,min:'',minItems:-1,minLength:-1,mini:-1,minimum:'',minl:-1,mo:'',multipleOf:'',p:'',pattern:'',t:'',type:'',ui:false,uniqueItems:false,value:[]},"
+ +
"items:{'$ref':'',_default:[],_enum:[],cf:'',collectionFormat:'',df:[],e:[],emax:false,emin:false,exclusiveMaximum:false,exclusiveMinimum:false,f:'',format:'',items:[],max:'',maxItems:-1,maxLength:-1,maxi:-1,maximum:'',maxl:-1,min:'',minItems:-1,minLength:-1,mini:-1,minimum:'',minl:-1,mo:'',multipleOf:'',p:'',pattern:'',t:'',type:'',ui:false,uniqueItems:false},"
+ "max:'max',"
+ "maxItems:2,"
+ "maxLength:4,"
@@ -138,8 +136,7 @@ public class ItemsAnnotation_Test {
+ "t:'t',"
+ "type:'type',"
+ "ui:true,"
- + "uniqueItems:true,"
- + "value:['value']"
+ + "uniqueItems:true"
+ "}"
);
}
@@ -202,8 +199,7 @@ public class ItemsAnnotation_Test {
t="t",
type="type",
ui=true,
- uniqueItems=true,
- value="value"
+ uniqueItems=true
)
public static class D1 {}
Items d1 = D1.class.getAnnotationsByType(Items.class)[0];
@@ -241,8 +237,7 @@ public class ItemsAnnotation_Test {
t="t",
type="type",
ui=true,
- uniqueItems=true,
- value="value"
+ uniqueItems=true
)
public static class D2 {}
Items d2 = D2.class.getAnnotationsByType(Items.class)[0];
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation_Test.java
index 3987af6..e26d0ca 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation_Test.java
@@ -85,7 +85,6 @@ public class SchemaAnnotation_Test {
.type("type")
.ui(true)
.uniqueItems(true)
- .value("value")
.xml("xml")
.build();
@@ -143,7 +142,6 @@ public class SchemaAnnotation_Test {
.type("type")
.ui(true)
.uniqueItems(true)
- .value("value")
.xml("xml")
.build();
@@ -169,11 +167,11 @@ public class SchemaAnnotation_Test {
+ "emin:true,"
+ "exclusiveMaximum:true,"
+ "exclusiveMinimum:true,"
- +
"externalDocs:{description:[],url:'',value:[]},"
+ + "externalDocs:{description:[],url:''},"
+ "f:'f',"
+ "format:'format',"
+ "ignore:true,"
- +
"items:{'$ref':'',_default:[],_enum:[],cf:'',collectionFormat:'',df:[],e:[],emax:false,emin:false,exclusiveMaximum:false,exclusiveMinimum:false,f:'',format:'',items:{'$ref':'',_default:[],_enum:[],cf:'',collectionFormat:'',df:[],e:[],emax:false,emin:false,exclusiveMaximum:false,exclusiveMinimum:false,f:'',format:'',items:[],max:'',maxItems:-1,maxLength:-1,maxi:-1,maximum:'',maxl:-1,min:'',minItems:-1,minLength:-1,mini:-1,minimum:'',minl:-1,mo:'',multipleOf:'',p:'',pattern:'',t:'',t
[...]
+ +
"items:{'$ref':'',_default:[],_enum:[],cf:'',collectionFormat:'',df:[],e:[],emax:false,emin:false,exclusiveMaximum:false,exclusiveMinimum:false,f:'',format:'',items:{'$ref':'',_default:[],_enum:[],cf:'',collectionFormat:'',df:[],e:[],emax:false,emin:false,exclusiveMaximum:false,exclusiveMinimum:false,f:'',format:'',items:[],max:'',maxItems:-1,maxLength:-1,maxi:-1,maximum:'',maxl:-1,min:'',minItems:-1,minLength:-1,mini:-1,minimum:'',minl:-1,mo:'',multipleOf:'',p:'',pattern:'',t:'',t
[...]
+ "max:'max',"
+ "maxItems:2,"
+ "maxLength:4,"
@@ -207,7 +205,6 @@ public class SchemaAnnotation_Test {
+ "type:'type',"
+ "ui:true,"
+ "uniqueItems:true,"
- + "value:['value'],"
+ "xml:['xml']"
+ "}"
);
@@ -314,7 +311,6 @@ public class SchemaAnnotation_Test {
type="type",
ui=true,
uniqueItems=true,
- value="value",
xml="xml"
)
public static class D1 {}
@@ -374,7 +370,6 @@ public class SchemaAnnotation_Test {
type="type",
ui=true,
uniqueItems=true,
- value="value",
xml="xml"
)
public static class D2 {}
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SubItemsAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SubItemsAnnotation_Test.java
index 41fdaa0..9f63a7b 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SubItemsAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/jsonschema/annotation/SubItemsAnnotation_Test.java
@@ -61,7 +61,6 @@ public class SubItemsAnnotation_Test {
.type("type")
.ui(true)
.uniqueItems(true)
- .value("value")
.build();
SubItems a2 = SubItemsAnnotation.create()
@@ -98,7 +97,6 @@ public class SubItemsAnnotation_Test {
.type("type")
.ui(true)
.uniqueItems(true)
- .value("value")
.build();
@Test
@@ -138,8 +136,7 @@ public class SubItemsAnnotation_Test {
+ "t:'t',"
+ "type:'type',"
+ "ui:true,"
- + "uniqueItems:true,"
- + "value:['value']"
+ + "uniqueItems:true"
+ "}"
);
}
@@ -202,8 +199,7 @@ public class SubItemsAnnotation_Test {
t="t",
type="type",
ui=true,
- uniqueItems=true,
- value="value"
+ uniqueItems=true
)
public static class D1 {}
SubItems d1 = D1.class.getAnnotationsByType(SubItems.class)[0];
@@ -241,8 +237,7 @@ public class SubItemsAnnotation_Test {
t="t",
type="type",
ui=true,
- uniqueItems=true,
- value="value"
+ uniqueItems=true
)
public static class D2 {}
SubItems d2 = D2.class.getAnnotationsByType(SubItems.class)[0];
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/Swagger_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/Swagger_Test.java
index f45e230..f1e1f60 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/rest/Swagger_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/rest/Swagger_Test.java
@@ -289,8 +289,8 @@ public class Swagger_Test {
description="$L{baz}",
version="$L{foo}",
termsOfService="$L{foo}",
-
contact=@Contact("{name:'$L{foo}',url:'$L{bar}',email:'$L{baz}'}"),
- license=@License("{name:'$L{foo}',url:'$L{bar}'}")
+
contact=@Contact(name="$L{foo}",url="$L{bar}",email="$L{baz}"),
+ license=@License(name="$L{foo}",url="$L{bar}")
),
messages="BasicRestInfoProviderTest"
)
@@ -399,7 +399,7 @@ public class Swagger_Test {
@Rest(
swagger=@Swagger(
value="{tags:[{name:'a-name',description:'a-description',externalDocs:{description:'a-description',url:'a-url'}}]}",
- tags=@Tag(name="b-name",value=" {
description:'b-description', externalDocs: { description:'b-description',
url:'b-url' } } ")
+ tags=@Tag(name="b-name",description="b-description",
externalDocs=@ExternalDocs(description="b-description",url="b-url"))
)
)
public static class C4 {}
@@ -439,7 +439,7 @@ public class Swagger_Test {
swagger=@Swagger(
tags={
@Tag(name="s-name",description="b-description",externalDocs=@ExternalDocs(description="b-description",url="b-url")),
-
@Tag(name="s-name",value="{description:'c-description',externalDocs:{description:'c-description',url:'c-url'}}")
+
@Tag(name="s-name",description="c-description",externalDocs=@ExternalDocs(description="c-description",url="c-url"))
}
)
)
@@ -624,8 +624,8 @@ public class Swagger_Test {
@Rest(
swagger=@Swagger(
value="{info:{externalDocs:{description:'a-description',url:'a-url'}}}",
- externalDocs=@ExternalDocs("
description:'b-description', url:'b-url' ")
- )
+ externalDocs=@ExternalDocs(description="b-description",
url="b-url")
+ )
)
public static class D4 {}
@@ -643,7 +643,7 @@ public class Swagger_Test {
@Rest(
swagger=@Swagger(
value="{externalDocs:{description:'a-description',url:'a-url'}}",
-
externalDocs=@ExternalDocs("{description:'$L{foo}',url:'$L{bar}'}")
+
externalDocs=@ExternalDocs(description="$L{foo}",url="$L{bar}")
),
messages="BasicRestInfoProviderTest"
)
@@ -1040,7 +1040,7 @@ public class Swagger_Test {
@Rest(swagger=@Swagger("paths:{'/path/{foo}':{get:{externalDocs:{description:'a-description',url:'a-url'}}}}"))
public static class G5 {
-
@RestGet(path="/path/{foo}",swagger=@OpSwagger(externalDocs=@ExternalDocs("{description:'d-description',url:'d-url'}")))
+
@RestGet(path="/path/{foo}",swagger=@OpSwagger(externalDocs=@ExternalDocs(description="d-description",url="d-url")))
public X a() {
return null;
}
@@ -1054,7 +1054,7 @@ public class Swagger_Test {
@Rest(messages="BasicRestInfoProviderTest",
swagger=@Swagger("paths:{'/path/{foo}':{get:{externalDocs:{description:'a-description',url:'a-url'}}}}"))
public static class G6 {
-
@RestGet(path="/path/{foo}",swagger=@OpSwagger(externalDocs=@ExternalDocs("{description:'$L{foo}',url:'$L{foo}'}")))
+
@RestGet(path="/path/{foo}",swagger=@OpSwagger(externalDocs=@ExternalDocs(description="$L{foo}",url="$L{foo}")))
public X a() {
return null;
}
@@ -2158,7 +2158,7 @@ public class Swagger_Test {
@RestGet(path="/path/{foo}/responses/100")
public S5c a() {return null;}
}
- @Response(code=100,schema=@Schema("{$ref:'$L{foo}'}"))
+ @Response(code=100,schema=@Schema($ref="l-foo"))
public static class S5c extends X {}
@Test
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation_Test.java
index 5bde4ee..ec243f8 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/OpSwaggerAnnotation_Test.java
@@ -64,7 +64,7 @@ public class OpSwaggerAnnotation_Test {
+ "consumes:['consumes'],"
+ "deprecated:'deprecated',"
+ "description:['description'],"
- +
"externalDocs:{description:[],url:'',value:[]},"
+ + "externalDocs:{description:[],url:''},"
+ "operationId:'operationId',"
+ "parameters:['parameters'],"
+ "produces:['produces'],"
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 c104194..5defc39 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
@@ -90,7 +90,7 @@ public class ResponseHeader_Test {
@ResponseHeader(
name="H",
- schema=@Schema("{description:'a',type:'string'}")
+ schema=@Schema(description="a",type="string")
)
public static class B2 {}
@RestGet
@@ -98,7 +98,7 @@ public class ResponseHeader_Test {
@ResponseHeader(
name="H",
- schema=@Schema("description:'b',type:'number'}"),
+ schema=@Schema(description="b",type="number"),
description="a"
)
@Schema(
@@ -184,7 +184,7 @@ public class ResponseHeader_Test {
public void b(
@ResponseHeader(
name="H",
-
schema=@Schema("{description:'a',type:'string'}")
+ schema=@Schema(description="a",type="string")
)
Value<C2> h) {}
@@ -193,7 +193,7 @@ public class ResponseHeader_Test {
public void c(
@ResponseHeader(
name="H",
-
schema=@Schema("{description:'b',type:'number'}"),
+ schema=@Schema(description="b",type="number"),
description="a"
)
@Schema(
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
index c3489c6..6af53d8 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
@@ -196,7 +196,7 @@ public class RestAnnotation_Test {
+
"serializers:['org.apache.juneau.serializer.Serializer'],"
+ "siteName:'siteName',"
+
"staticFiles:'org.apache.juneau.rest.StaticFiles',"
- +
"swagger:{contact:{email:'',name:'',url:'',value:[]},description:[],externalDocs:{description:[],url:'',value:[]},license:{name:'',url:'',value:[]},tags:[],termsOfService:[],title:[],value:[],version:''},"
+ +
"swagger:{contact:{email:'',name:'',url:''},description:[],externalDocs:{description:[],url:''},license:{name:'',url:''},tags:[],termsOfService:[],title:[],value:[],version:''},"
+
"swaggerProvider:'org.apache.juneau.rest.BasicSwaggerProvider',"
+ "title:['title'],"
+ "uriAuthority:'uriAuthority',"
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation_Test.java
index 33a5ac7..8bb00e3 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestDeleteAnnotation_Test.java
@@ -99,7 +99,7 @@ public class RestDeleteAnnotation_Test {
+ "roleGuard:'roleGuard',"
+ "rolesDeclared:'rolesDeclared',"
+ "summary:'summary',"
- +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:'',value:[]},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:''},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ "value:'value'"
+ "}"
);
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestGetAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestGetAnnotation_Test.java
index 0688710..bca4bf6 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestGetAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestGetAnnotation_Test.java
@@ -109,7 +109,7 @@ public class RestGetAnnotation_Test {
+ "rolesDeclared:'rolesDeclared',"
+
"serializers:['org.apache.juneau.serializer.Serializer'],"
+ "summary:'summary',"
- +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:'',value:[]},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:''},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ "value:'value'"
+ "}"
);
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOpAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOpAnnotation_Test.java
index 7f9cc7b..714b2ff 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOpAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOpAnnotation_Test.java
@@ -128,7 +128,7 @@ public class RestOpAnnotation_Test {
+ "rolesDeclared:'rolesDeclared',"
+
"serializers:['org.apache.juneau.serializer.Serializer'],"
+ "summary:'summary',"
- +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:'',value:[]},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:''},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ "value:'value'"
+ "}"
);
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPostAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPostAnnotation_Test.java
index 860116d..54e5182 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPostAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPostAnnotation_Test.java
@@ -125,7 +125,7 @@ public class RestPostAnnotation_Test {
+ "rolesDeclared:'rolesDeclared',"
+
"serializers:['org.apache.juneau.serializer.Serializer'],"
+ "summary:'summary',"
- +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:'',value:[]},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:''},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ "value:'value'"
+ "}"
);
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPutAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPutAnnotation_Test.java
index e059dbb..60d49a7 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPutAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestPutAnnotation_Test.java
@@ -125,7 +125,7 @@ public class RestPutAnnotation_Test {
+ "rolesDeclared:'rolesDeclared',"
+
"serializers:['org.apache.juneau.serializer.Serializer'],"
+ "summary:'summary',"
- +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:'',value:[]},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ +
"swagger:{consumes:[],deprecated:'',description:[],externalDocs:{description:[],url:''},operationId:'',parameters:[],produces:[],responses:[],schemes:[],summary:[],tags:[],value:[]},"
+ "value:'value'"
+ "}"
);
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/SwaggerAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/SwaggerAnnotation_Test.java
index b8d8dea..e3dd08c 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/SwaggerAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/SwaggerAnnotation_Test.java
@@ -55,11 +55,11 @@ public class SwaggerAnnotation_Test {
public void a01_basic() {
assertObject(a1).asJson().is(""
+ "{"
- + "contact:{email:'',name:'',url:'',value:[]},"
+ + "contact:{email:'',name:'',url:''},"
+ "description:['description'],"
- +
"externalDocs:{description:[],url:'',value:[]},"
- + "license:{name:'',url:'',value:[]},"
- +
"tags:[{description:[],externalDocs:{description:[],url:'',value:[]},name:'',value:[]}],"
+ + "externalDocs:{description:[],url:''},"
+ + "license:{name:'',url:''},"
+ +
"tags:[{description:[],externalDocs:{description:[],url:''},name:''}],"
+ "termsOfService:['termsOfService'],"
+ "title:['title'],"
+ "value:['value'],"
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Body_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Body_Test.java
index 0327ad1..236ac76 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Body_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/Swagger_Body_Test.java
@@ -47,10 +47,10 @@ public class Swagger_Body_Test {
public void a(A1 h) {}
@Body(description="a\nb")
- @Schema({
- "required:true,",
- "type:'string'",
- })
+ @Schema(
+ required=true,
+ type="string"
+ )
public static class A2 {
public A2(String x) {}
}
@@ -94,7 +94,7 @@ public class Swagger_Body_Test {
public static class B {
@Body
- @Schema(" type:'b' ")
+ @Schema(type="object")
public static class B1 {}
@RestGet
public void a(B1 h) {}
@@ -125,7 +125,7 @@ public class Swagger_Body_Test {
ParameterInfo x;
x = s.getParameterInfo("/a","get","body",null);
- assertObject(x.getSchema()).asJson().is("{type:'b'}");
+ assertObject(x.getSchema()).asJson().is("{type:'object'}");
x = s.getParameterInfo("/b","put","body",null);
assertObject(x.getSchema()).asJson().is("{type:'object',properties:{f1:{type:'string'}}}");
@@ -162,10 +162,10 @@ public class Swagger_Body_Test {
@RestPut
public void b(
@Body(description="a\nb")
- @Schema({
- "required:true,",
- "type:'string'",
- })
+ @Schema(
+ required=true,
+ type="string"
+ )
D2 b) {}
public static class D3 {
@@ -178,10 +178,8 @@ public class Swagger_Body_Test {
d= {"b","c"}
)
@Schema(
- value= {
- "required:true,",
- "type:'string'"
- }
+ required=true,
+ type="string"
)
D3 b) {}
}
@@ -212,7 +210,7 @@ public class Swagger_Body_Test {
public static class E1 {}
@RestGet
- public void a(@Body()@Schema(" { type:'b' } ") E1 b) {}
+ public void a(@Body @Schema(type="object") E1 b) {}
public static class E2 {
public String f1;
@@ -243,7 +241,7 @@ public class Swagger_Body_Test {
ParameterInfo x;
x = s.getParameterInfo("/a","get","body",null);
- assertObject(x.getSchema()).asJson().is("{type:'b'}");
+ assertObject(x.getSchema()).asJson().is("{type:'object'}");
x = s.getParameterInfo("/b","put","body",null);
assertObject(x.getSchema()).asJson().is("{type:'object',properties:{f1:{type:'string'}}}");
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 b99c8f3..b6066d6 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,7 +46,7 @@ public class Swagger_FormData_Test {
@FormData(
name="F",
- schema=@Schema("{description:'a\nb',type:'string'}")
+ schema=@Schema(description="a\nb",type="string")
)
public static class A2 {
public A2(String x) {}
@@ -56,7 +56,7 @@ public class Swagger_FormData_Test {
@FormData(
name="F",
- schema=@Schema("{description:'b\nc',type:'string'}"),
+ schema=@Schema(description="b\nc",type="string"),
description= {"a","b"}
)
@Schema(type="string")
@@ -158,14 +158,14 @@ public class Swagger_FormData_Test {
public void b(
@FormData(
name="F",
-
schema=@Schema("{description:'a\nb',type:'string'}")
+ schema=@Schema(description="a\nb",type="string")
) String f) {}
@RestPost
public void c(
@FormData(
name="F",
-
schema=@Schema("{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 e6192ca..bf58d02 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,7 +46,7 @@ public class Swagger_Header_Test {
@Header(
name="H",
- schema=@Schema("{description:'a\nb',type:'string'}")
+ schema=@Schema(description="a\nb",type="string")
)
public static class A2 {
public A2(String x) {}
@@ -56,7 +56,7 @@ public class Swagger_Header_Test {
@Header(
name="H",
- schema=@Schema("{description:'b\nc',type:'string'}"),
+ schema=@Schema(description="b\nc",type="string"),
description={"a","b"}
)
@Schema(type="string")
@@ -147,14 +147,14 @@ public class Swagger_Header_Test {
public void b(
@Header(
name="H",
-
schema=@Schema("{description:'a\nb',type:'string'}")
+ schema=@Schema(description="a\nb",type="string")
) String h) {}
@RestPost
public void c(
@Header(
name="H",
-
schema=@Schema("{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 b09c205..b49ad60 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,7 +53,7 @@ public class Swagger_Path_Test {
@Path(
n="P",
-
schema=@Schema("{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) {}
@@ -67,7 +67,7 @@ public class Swagger_Path_Test {
@Path(
n="P",
-
schema=@Schema("{description:'b\nc',type:'string',enum:['b','c']}"),
+
schema=@Schema(description="b\nc",type="string",_enum={"b","c"}),
d={"a","b"}
)
@Schema(
@@ -96,7 +96,7 @@ public class Swagger_Path_Test {
public void d(A4 f) {}
@Path(n="P")
- @Schema(e={" ['a','b'] "})
+ @Schema(e="a,b")
public static class A5 {
@Override
public String toString() {
@@ -202,13 +202,13 @@ public class Swagger_Path_Test {
@RestPut(path="/b/{P}")
public void b(@Path(
n="P",
- schema=@Schema("{description:'a',type:'string'}")
+ schema=@Schema(description="a",type="string")
) String h) {}
@RestPost(path="/c/{P}")
public void c(@Path(
n="P",
- schema=@Schema("{description:'b',type:'string'}"),
+ schema=@Schema(description="b",type="string"),
d="a"
)
@Schema(t="string")
@@ -218,7 +218,7 @@ public class Swagger_Path_Test {
public void d(@Path("P") String h) {}
@RestOp(path="/e/{P}")
- public void e(@Path("P") @Schema(e={" ['a','b'] "}) String h) {}
+ public void e(@Path("P") @Schema(e="a,b") String h) {}
}
@Test
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 c2e3b87..0ab809f 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,7 +46,7 @@ public class Swagger_Query_Test {
@Query(
n="Q",
- schema=@Schema("{description: 'a\nb',type:'string'}")
+ schema=@Schema(description="a\nb",type="string")
)
public static class A2 {
public A2(String x) {}
@@ -56,7 +56,7 @@ public class Swagger_Query_Test {
@Query(
n="Q",
- schema=@Schema("{description: 'b\nc',type:'string'}"),
+ schema=@Schema(description="b\nc",type="string"),
d={"a","b"}
)
@Schema(t="string")
@@ -158,7 +158,7 @@ public class Swagger_Query_Test {
public void b(
@Query(
n="Q",
- schema=@Schema("{description:
'a\nb',type:'string'}")
+ schema=@Schema(description="a\nb",type="string")
)
String q) {}
@@ -166,7 +166,7 @@ public class Swagger_Query_Test {
public void c(
@Query(
n="Q",
- schema=@Schema("{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 a264ba1..4223d8a 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",schema=@Schema("{type:'b'}")))
+
@Response(headers=@ResponseHeader(name="foo",schema=@Schema(type="object")))
public static class A6 {}
@RestOp
public void k(Value<A6> r) {}
@@ -171,16 +171,16 @@ public class Swagger_Response_Test {
assertEquals("Continue", x.getDescription());
x = s.getResponseInfo("/k","get",200);
- assertObject(x.getHeaders()).asJson().is("{foo:{type:'b'}}");
+
assertObject(x.getHeaders()).asJson().is("{foo:{type:'object'}}");
x = s.getResponseInfo("/l","get",200);
- assertObject(x.getHeaders()).asJson().is("{foo:{type:'b'}}");
+
assertObject(x.getHeaders()).asJson().is("{foo:{type:'object'}}");
}
@Rest
public static class B {
- @Response(schema=@Schema(" type:'number' "))
+ @Response(schema=@Schema(type="number"))
public static class B1 {}
@RestGet
public void a(Value<B1> r) {}
@@ -338,7 +338,7 @@ public class Swagger_Response_Test {
@RestOp
public void e() throws D5 {}
- @Response(headers=@ResponseHeader(name="foo", schema=@Schema("
{type:'number'} ")))
+ @Response(headers=@ResponseHeader(name="foo",
schema=@Schema(type="number")))
public static class D6 extends Throwable {}
@RestOp
public void f() throws D6 {}
@@ -383,7 +383,7 @@ public class Swagger_Response_Test {
@Rest
public static class E {
- @Response(schema=@Schema(" type:'number' "))
+ @Response(schema=@Schema(type="number"))
public static class E1 extends Throwable {}
@RestGet
public void a() throws E1 {}