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 6b2e148 Swagger improvements.
6b2e148 is described below
commit 6b2e14851f34deed8c82da1b8812744fa67dbeb0
Author: JamesBognar <[email protected]>
AuthorDate: Mon Apr 23 15:46:50 2018 -0400
Swagger improvements.
---
.../org/apache/juneau/internal/StringUtils.java | 10 +++
.../apache/juneau/rest/BasicRestInfoProvider.java | 40 +++++------
.../org/apache/juneau/rest/RestMethodReturn.java | 8 +--
.../org/apache/juneau/rest/RestMethodThrown.java | 8 +--
.../org/apache/juneau/rest/RestParamDefaults.java | 80 ++++++++++------------
.../apache/juneau/rest/annotation/FormData.java | 18 +++--
.../org/apache/juneau/rest/annotation/Header.java | 18 +++--
.../org/apache/juneau/rest/annotation/Path.java | 12 ++--
.../org/apache/juneau/rest/annotation/Query.java | 17 +++--
.../apache/juneau/rest/annotation/Response.java | 2 +-
10 files changed, 118 insertions(+), 95 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
index 14153b4..d7717a4 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/StringUtils.java
@@ -465,6 +465,16 @@ public final class StringUtils {
}
return sb.toString();
}
+
+ /**
+ * Joins tokens with newlines.
+ *
+ * @param tokens The tokens to concatenate.
+ * @return A string with the specified tokens contatenated with
newlines.
+ */
+ public static String joinnl(Object[] tokens) {
+ return join(tokens, '\n');
+ }
/**
* Shortcut for calling <code>split(s, <js>','</js>)</code>
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
index 3f8c4f2..80cc9d8 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
@@ -194,21 +194,21 @@ public class BasicRestInfoProvider implements
RestInfoProvider {
ResourceSwagger r = rr.swagger();
- omSwagger.putAll(parseMap(join(r.value()), vr, true,
false, "@ResourceSwagger(value) on class {0}", c));
+ omSwagger.putAll(parseMap(joinnl(r.value()), vr, true,
false, "@ResourceSwagger(value) on class {0}", c));
if (r.title().length + r.description().length +
r.version().length() + r.contact().length + r.license().length +
r.termsOfService().length > 0) {
ObjectMap info = omSwagger.getObjectMap("info",
true);
- info.appendIf(true, true, true, "title",
vr.resolve(join(r.title())));
- info.appendIf(true, true, true, "description",
vr.resolve(join(r.description())));
- info.appendIf(true, true, true, "version",
vr.resolve(join(r.version())));
- info.appendIf(true, true, true,
"termsOfService", vr.resolve(join(r.termsOfService())));
- info.appendIf(true, true, true, "contact",
parseMap(join(r.contact()), vr, false, true, "@ResourceSwagger(contact) on
class {0}", c));
- info.appendIf(true, true, true, "license",
parseMap(join(r.license()), vr, false, true, "@ResourceSwagger(license) on
class {0}", c));
+ info.appendIf(true, true, true, "title",
vr.resolve(joinnl(r.title())));
+ info.appendIf(true, true, true, "description",
vr.resolve(joinnl(r.description())));
+ info.appendIf(true, true, true, "version",
vr.resolve(r.version()));
+ info.appendIf(true, true, true,
"termsOfService", vr.resolve(joinnl(r.termsOfService())));
+ info.appendIf(true, true, true, "contact",
parseMap(joinnl(r.contact()), vr, false, true, "@ResourceSwagger(contact) on
class {0}", c));
+ info.appendIf(true, true, true, "license",
parseMap(joinnl(r.license()), vr, false, true, "@ResourceSwagger(license) on
class {0}", c));
}
- omSwagger.appendIf(true, true, true, "externalDocs",
parseMap(join(r.externalDocs()), vr, false, true,
"@ResourceSwagger(externalDocs) on class {0}", c));
+ omSwagger.appendIf(true, true, true, "externalDocs",
parseMap(joinnl(r.externalDocs()), vr, false, true,
"@ResourceSwagger(externalDocs) on class {0}", c));
- ObjectList tags = parseList(join(r.tags()), vr, false,
true, "@ResourceSwagger(tags) on class {0}", c);
+ ObjectList tags = parseList(joinnl(r.tags()), vr,
false, true, "@ResourceSwagger(tags) on class {0}", c);
if (tags != null)
omSwagger.getObjectList("tags",
true).addAll(tags);
}
@@ -276,20 +276,20 @@ public class BasicRestInfoProvider implements
RestInfoProvider {
// Add @RestMethod(swagger)
MethodSwagger ms = rm.swagger();
- op.putAll(parseMap(join(ms.value()), vr, true, false,
"@MethodSwagger(value) on class {0} method {1}", c, m));
+ op.putAll(parseMap(joinnl(ms.value()), vr, true, false,
"@MethodSwagger(value) on class {0} method {1}", c, m));
op.appendIf(true, true, true, "summary",
vr.resolve(rm.summary()));
- op.appendIf(true, true, true, "summary",
vr.resolve(join(ms.summary())));
- op.appendIf(true, true, true, "description",
vr.resolve(join(rm.description())));
- op.appendIf(true, true, true, "description",
vr.resolve(join(ms.description())));
+ op.appendIf(true, true, true, "summary",
vr.resolve(joinnl(ms.summary())));
+ op.appendIf(true, true, true, "description",
vr.resolve(joinnl(rm.description())));
+ op.appendIf(true, true, true, "description",
vr.resolve(joinnl(ms.description())));
op.appendIf(true, true, true, "deprecated",
vr.resolve(ms.deprecated()));
- op.appendIf(true, true, true, "externalDocs",
parseMap(join(ms.externalDocs()), vr, false, true,
"@MethodSwagger(externalDocs) on class {0} method {1}", c, m));
+ op.appendIf(true, true, true, "externalDocs",
parseMap(joinnl(ms.externalDocs()), vr, false, true,
"@MethodSwagger(externalDocs) on class {0} method {1}", c, m));
if (ms.parameters().length > 0)
- op.getObjectList("parameters",
true).addAll(parseList(join(ms.parameters()), vr, false, false,
"@MethodSwagger(parameters) on class {0} method {1}", c, m));
+ op.getObjectList("parameters",
true).addAll(parseList(joinnl(ms.parameters()), vr, false, false,
"@MethodSwagger(parameters) on class {0} method {1}", c, m));
if (ms.responses().length > 0)
- op.getObjectMap("responses",
true).putAll(parseMap(join(ms.responses()), vr, false, false,
"@MethodSwagger(responses) on class {0} method {1}", c, m));
+ op.getObjectMap("responses",
true).putAll(parseMap(joinnl(ms.responses()), vr, false, false,
"@MethodSwagger(responses) on class {0} method {1}", c, m));
if (ms.tags().length > 0)
- op.getObjectList("tags",
true).addAll(parseListOrCdl(join(ms.tags()), vr, false, false,
"@MethodSwagger(tags) on class {0} method {1}", c, m));
+ op.getObjectList("tags",
true).addAll(parseListOrCdl(joinnl(ms.tags()), vr, false, false,
"@MethodSwagger(tags) on class {0} method {1}", c, m));
op.putIfNotExists("operationId", mn);
@@ -522,10 +522,6 @@ public class BasicRestInfoProvider implements
RestInfoProvider {
return swagger;
}
- private String join(String...s) {
- return StringUtils.join(s, '\n');
- }
-
private Object parseAnything(String s) throws ParseException {
if (s == null)
return null;
@@ -806,7 +802,7 @@ public class BasicRestInfoProvider implements
RestInfoProvider {
public String getMethodDescription(Method method, RestRequest req)
throws Exception {
VarResolverSession vr = req.getVarResolverSession();
- String s =
join(method.getAnnotation(RestMethod.class).description());
+ String s =
joinnl(method.getAnnotation(RestMethod.class).description());
if (s.isEmpty()) {
Operation o = getSwaggerOperation(method, req);
if (o != null)
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodReturn.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodReturn.java
index e6a11f7..55d408e 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodReturn.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodReturn.java
@@ -37,10 +37,10 @@ public class RestMethodReturn {
if (type instanceof Class)
for (Response ri :
ReflectionUtils.findAnnotationsParentFirst(Response.class, (Class<?>)type)) {
code = ObjectUtils.firstNonZero(ri.code(), ri.value(),
code);
- metaData.appendSkipEmpty("description",
ri.description());
- metaData.appendSkipEmpty("example", join(ri.example(),
""));
- metaData.appendSkipEmpty("headers", join(ri.headers(),
""));
- metaData.appendSkipEmpty("schema", join(ri.schema(),
""));
+ metaData.appendSkipEmpty("description",
joinnl(ri.description()));
+ metaData.appendSkipEmpty("example",
joinnl(ri.example()));
+ metaData.appendSkipEmpty("headers",
joinnl(ri.headers()));
+ metaData.appendSkipEmpty("schema", joinnl(ri.schema()));
}
this.code = code;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodThrown.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodThrown.java
index 65203b2..7fb8e73 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodThrown.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestMethodThrown.java
@@ -36,10 +36,10 @@ public class RestMethodThrown {
int code = 500;
for (Response ri :
ReflectionUtils.findAnnotationsParentFirst(Response.class, type)) {
code = ObjectUtils.firstNonZero(ri.code(), ri.value(),
code);
- metaData.appendSkipEmpty("description",
ri.description());
- metaData.appendSkipEmpty("example", join(ri.example(),
""));
- metaData.appendSkipEmpty("headers", join(ri.headers(),
""));
- metaData.appendSkipEmpty("schema", join(ri.schema(),
""));
+ metaData.appendSkipEmpty("description",
joinnl(ri.description()));
+ metaData.appendSkipEmpty("example",
joinnl(ri.example()));
+ metaData.appendSkipEmpty("headers",
joinnl(ri.headers()));
+ metaData.appendSkipEmpty("schema", joinnl(ri.schema()));
}
this.code = code;
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
index 5778f6c..21555d6 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
@@ -560,7 +560,7 @@ class RestParamDefaults {
if (a == null)
return ObjectMap.EMPTY_MAP;
return new ObjectMap()
- .appendSkipEmpty("description", a.description())
+ .appendSkipEmpty("description",
joinnl(a.description()))
.appendSkipEmpty("type", a.type())
.appendSkipEmpty("format", a.format())
.appendSkipEmpty("pattern", a.pattern())
@@ -572,9 +572,9 @@ class RestParamDefaults {
.appendSkipEmpty("allowEmptyVals",
a.allowEmptyVals())
.appendSkipEmpty("exclusiveMaximum",
a.exclusiveMaximum())
.appendSkipEmpty("exclusiveMimimum",
a.exclusiveMimimum())
- .appendSkipEmpty("schema", a.schema())
- .appendSkipEmpty("enum", a._enum())
- .appendSkipEmpty("example", a.example())
+ .appendSkipEmpty("schema", joinnl(a.schema()))
+ .appendSkipEmpty("enum", joinnl(a._enum()))
+ .appendSkipEmpty("example", joinnl(a.example()))
;
}
}
@@ -595,7 +595,7 @@ class RestParamDefaults {
if (a == null)
return om;
return om
- .appendSkipEmpty("description",
join(a.description()))
+ .appendSkipEmpty("description",
joinnl(a.description()))
.appendSkipEmpty("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipEmpty("format", a.format())
@@ -612,11 +612,11 @@ class RestParamDefaults {
.appendSkipEmpty("exclusiveMaximum",
a.exclusiveMaximum())
.appendSkipEmpty("exclusiveMimimum",
a.exclusiveMimimum())
.appendSkipEmpty("uniqueItems", a.uniqueItems())
- .appendSkipEmpty("schema", join(a.schema()))
- .appendSkipEmpty("default", join(a._default()))
- .appendSkipEmpty("enum", join(a._enum()))
- .appendSkipEmpty("items", join(a.items()))
- .appendSkipEmpty("example", join(a.example()))
+ .appendSkipEmpty("schema", joinnl(a.schema()))
+ .appendSkipEmpty("default",
joinnl(a._default()))
+ .appendSkipEmpty("enum", joinnl(a._enum()))
+ .appendSkipEmpty("items", joinnl(a.items()))
+ .appendSkipEmpty("example", joinnl(a.example()))
;
}
}
@@ -639,7 +639,7 @@ class RestParamDefaults {
if (a == null)
return om;
return om
- .appendSkipEmpty("description", a.description())
+ .appendSkipEmpty("description",
joinnl(a.description()))
.appendSkipEmpty("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipEmpty("format", a.format())
@@ -656,11 +656,11 @@ class RestParamDefaults {
.appendSkipEmpty("exclusiveMaximum",
a.exclusiveMaximum())
.appendSkipEmpty("exclusiveMinimum",
a.exclusiveMinimum())
.appendSkipEmpty("uniqueItems", a.uniqueItems())
- .appendSkipEmpty("schema", a.schema())
- .appendSkipEmpty("default", a._default())
- .appendSkipEmpty("enum", a._enum())
- .appendSkipEmpty("items", a.items())
- .appendSkipEmpty("example", a.example())
+ .appendSkipEmpty("schema", joinnl(a.schema()))
+ .appendSkipEmpty("default",
joinnl(a._default()))
+ .appendSkipEmpty("enum", joinnl(a._enum()))
+ .appendSkipEmpty("items", joinnl(a.items()))
+ .appendSkipEmpty("example", joinnl(a.example()))
;
}
}
@@ -714,7 +714,7 @@ class RestParamDefaults {
for (String c : StringUtils.split(code)) {
ObjectMap om2 = om.getObjectMap(c, true);
om2
- .appendSkipEmpty("description",
join(a.description()))
+ .appendSkipEmpty("description",
joinnl(a.description()))
.appendSkipEmpty("type", a.type())
.appendSkipEmpty("format", a.format())
.appendSkipEmpty("collectionFormat",
a.collectionFormat())
@@ -728,10 +728,10 @@ class RestParamDefaults {
.appendSkipEmpty("exclusiveMaximum",
a.exclusiveMaximum())
.appendSkipEmpty("exclusiveMimimum",
a.exclusiveMinimum())
.appendSkipEmpty("uniqueItems",
a.uniqueItems())
- .appendSkipEmpty("default",
join(a._default()))
- .appendSkipEmpty("enum",
join(a._enum()))
- .appendSkipEmpty("items",
join(a.items()))
- .appendSkipEmpty("example",
join(a.example()))
+ .appendSkipEmpty("default",
joinnl(a._default()))
+ .appendSkipEmpty("enum",
joinnl(a._enum()))
+ .appendSkipEmpty("items",
joinnl(a.items()))
+ .appendSkipEmpty("example",
joinnl(a.example()))
;
}
return om;
@@ -780,10 +780,10 @@ class RestParamDefaults {
int status = ObjectUtils.firstNonZero(a.code(),
a.value(), 200);
ObjectMap om2 = om.getObjectMap(String.valueOf(status),
true);
om2
- .appendSkipEmpty("description",
join(a.description()))
- .appendSkipEmpty("schema", join(a.schema()))
- .appendSkipEmpty("headers", join(a.headers()))
- .appendSkipEmpty("example", join(a.example()))
+ .appendSkipEmpty("description",
joinnl(a.description()))
+ .appendSkipEmpty("schema", joinnl(a.schema()))
+ .appendSkipEmpty("headers", joinnl(a.headers()))
+ .appendSkipEmpty("example", joinnl(a.example()))
;
return om;
}
@@ -831,7 +831,7 @@ class RestParamDefaults {
int status = firstNonZero(a.code(), a.value(), 200);
ObjectMap om2 = om.getObjectMap(String.valueOf(status),
true);
om2
- .appendSkipEmpty("description",
join(a.description()))
+ .appendSkipEmpty("description",
joinnl(a.description()))
;
return om;
}
@@ -875,7 +875,7 @@ class RestParamDefaults {
if (a == null)
return om;
return om
- .appendSkipEmpty("description", a.description())
+ .appendSkipEmpty("description",
joinnl(a.description()))
.appendSkipEmpty("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipEmpty("format", a.format())
@@ -892,11 +892,11 @@ class RestParamDefaults {
.appendSkipEmpty("exclusiveMaximum",
a.exclusiveMaximum())
.appendSkipEmpty("exclusiveMimimum",
a.exclusiveMimimum())
.appendSkipEmpty("uniqueItems", a.uniqueItems())
- .appendSkipEmpty("schema", a.schema())
- .appendSkipEmpty("default", a._default())
- .appendSkipEmpty("enum", a._enum())
- .appendSkipEmpty("items", a.items())
- .appendSkipEmpty("example", a.example())
+ .appendSkipEmpty("schema", joinnl(a.schema()))
+ .appendSkipEmpty("default",
joinnl(a._default()))
+ .appendSkipEmpty("enum", joinnl(a._enum()))
+ .appendSkipEmpty("items", joinnl(a.items()))
+ .appendSkipEmpty("example", joinnl(a.example()))
;
}
}
@@ -925,7 +925,7 @@ class RestParamDefaults {
if (a == null)
return om;
return om
- .appendSkipEmpty("description", a.description())
+ .appendSkipEmpty("description",
joinnl(a.description()))
.appendSkipEmpty("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipEmpty("format", a.format())
@@ -942,11 +942,11 @@ class RestParamDefaults {
.appendSkipEmpty("exclusiveMaximum",
a.exclusiveMaximum())
.appendSkipEmpty("exclusiveMimimum",
a.exclusiveMimimum())
.appendSkipEmpty("uniqueItems", a.uniqueItems())
- .appendSkipEmpty("schema", a.schema())
- .appendSkipEmpty("default", a._default())
- .appendSkipEmpty("enum", a._enum())
- .appendSkipEmpty("items", a.items())
- .appendSkipEmpty("example", a.example())
+ .appendSkipEmpty("schema", joinnl(a.schema()))
+ .appendSkipEmpty("default",
joinnl(a._default()))
+ .appendSkipEmpty("enum", joinnl(a._enum()))
+ .appendSkipEmpty("items", joinnl(a.items()))
+ .appendSkipEmpty("example", joinnl(a.example()))
;
}
@@ -1303,8 +1303,4 @@ class RestParamDefaults {
static final boolean isCollection(Type t) {
return
BeanContext.DEFAULT.getClassMeta(t).isCollectionOrArray();
}
-
- static final String join(String...s) {
- return StringUtils.join(s, '\n');
- }
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
index 4b7c666..267f782 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
@@ -114,12 +114,13 @@ public @interface FormData {
* <ul class='spaced-list'>
* <li>
* The format of the value is plain-text.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String description() default "";
+ String[] description() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/required</code>.
@@ -367,12 +368,13 @@ public @interface FormData {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String schema() default "";
+ String[] schema() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/default</code>.
@@ -381,12 +383,13 @@ public @interface FormData {
* <ul class='spaced-list'>
* <li>
* The format of the value is JSON.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _default() default "";
+ String[] _default() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/enum</code>.
@@ -395,12 +398,13 @@ public @interface FormData {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON array or
comma-delimited list.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _enum() default "";
+ String[] _enum() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/items</code>.
@@ -409,12 +413,13 @@ public @interface FormData {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String items() default "";
+ String[] items() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/x-example</code>.
@@ -427,10 +432,11 @@ public @interface FormData {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object or plain-text
string.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String example() default "";
+ String[] example() default {};
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
index cc0f474..8669992 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
@@ -87,12 +87,13 @@ public @interface Header {
* <ul class='spaced-list'>
* <li>
* The format of the value is plain-text.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String description() default "";
+ String[] description() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/required</code>.
@@ -340,12 +341,13 @@ public @interface Header {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String schema() default "";
+ String[] schema() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/default</code>.
@@ -354,12 +356,13 @@ public @interface Header {
* <ul class='spaced-list'>
* <li>
* The format of the value is JSON.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _default() default "";
+ String[] _default() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/enum</code>.
@@ -368,12 +371,13 @@ public @interface Header {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON array or
comma-delimited list.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _enum() default "";
+ String[] _enum() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/items</code>.
@@ -382,12 +386,13 @@ public @interface Header {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String items() default "";
+ String[] items() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/x-example</code>.
@@ -400,10 +405,11 @@ public @interface Header {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object or plain-text
string.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String example() default "";
+ String[] example() default {};
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Path.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Path.java
index 518dd66..6c1ff96 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Path.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Path.java
@@ -112,12 +112,13 @@ public @interface Path {
* <ul class='spaced-list'>
* <li>
* The format of the value is plain-text.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String description() default "";
+ String[] description() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/type</code>.
@@ -288,12 +289,13 @@ public @interface Path {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String schema() default "";
+ String[] schema() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/enum</code>.
@@ -302,12 +304,13 @@ public @interface Path {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON array or
comma-delimited list.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _enum() default "";
+ String[] _enum() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/x-example</code>.
@@ -320,10 +323,11 @@ public @interface Path {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object or plain-text
string.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String example() default "";
+ String[] example() default {};
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
index cfb4d33..6ba842c 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
@@ -110,12 +110,13 @@ public @interface Query {
* <ul class='spaced-list'>
* <li>
* The format of the value is plain-text.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String description() default "";
+ String[] description() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/required</code>.
@@ -363,12 +364,13 @@ public @interface Query {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String schema() default "";
+ String[] schema() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/default</code>.
@@ -377,12 +379,13 @@ public @interface Query {
* <ul class='spaced-list'>
* <li>
* The format of the value is JSON.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _default() default "";
+ String[] _default() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/enum</code>.
@@ -391,12 +394,13 @@ public @interface Query {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON array or
comma-delimited list.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String _enum() default "";
+ String[] _enum() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/items</code>.
@@ -410,7 +414,7 @@ public @interface Query {
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String items() default "";
+ String[] items() default {};
/**
* Defines the swagger value
<code>/paths/{path}/{method}/parameters/#/x-example</code>.
@@ -423,10 +427,11 @@ public @interface Query {
* <ul class='spaced-list'>
* <li>
* The format of the value is a JSON object or plain-text
string.
+ * <br>Multiple lines are concatenated with newlines.
* <li>
* Supports <a class="doclink"
href="../../../../../overview-summary.html#DefaultRestSvlVariables">initialization-time
and request-time variables</a>
* (e.g. <js>"$L{my.localized.variable}"</js>).
* </ul>
*/
- String example() default "";
+ String[] example() default {};
}
diff --git
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Response.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Response.java
index 23a22d6..45f1624 100644
---
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Response.java
+++
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Response.java
@@ -30,7 +30,7 @@ public @interface Response {
int value() default 0;
- String description() default "";
+ String[] description() default {};
String[] schema() default {};
--
To stop receiving notification emails like this one, please contact
[email protected].