You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2016/10/07 16:33:53 UTC
[11/11] incubator-juneau git commit: JUNEAU-16 - Support for Swagger
documentation
JUNEAU-16 - Support for Swagger documentation
Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/7f2bcfdd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/7f2bcfdd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/7f2bcfdd
Branch: refs/heads/master
Commit: 7f2bcfdd9750c74b0d11444eb009ebf59fd3f088
Parents: 30176c1
Author: JamesBognar <ja...@apache.org>
Authored: Fri Oct 7 12:33:37 2016 -0400
Committer: JamesBognar <ja...@apache.org>
Committed: Fri Oct 7 12:33:37 2016 -0400
----------------------------------------------------------------------
.../java/org/apache/juneau/BeanContext.java | 2 +-
.../main/java/org/apache/juneau/BeanMeta.java | 2 +-
.../org/apache/juneau/BeanPropertyMeta.java | 12 +-
.../main/java/org/apache/juneau/ClassMeta.java | 2 +-
.../java/org/apache/juneau/annotation/Bean.java | 8 +-
.../juneau/annotation/BeanConstructor.java | 4 +-
.../apache/juneau/annotation/BeanProperty.java | 4 +-
.../org/apache/juneau/annotation/Consumes.java | 10 +-
.../org/apache/juneau/annotation/Produces.java | 6 +-
.../org/apache/juneau/dto/cognos/Column.java | 2 +-
.../org/apache/juneau/dto/cognos/DataSet.java | 2 +-
.../apache/juneau/dto/jsonschema/Schema.java | 11 +-
.../apache/juneau/dto/jsonschema/package.html | 2 +-
.../org/apache/juneau/dto/swagger/Contact.java | 118 +++
.../dto/swagger/ExternalDocumentation.java | 93 ++
.../org/apache/juneau/dto/swagger/Header.java | 582 +++++++++++
.../org/apache/juneau/dto/swagger/Info.java | 205 ++++
.../org/apache/juneau/dto/swagger/Items.java | 558 +++++++++++
.../org/apache/juneau/dto/swagger/License.java | 93 ++
.../apache/juneau/dto/swagger/Operation.java | 611 ++++++++++++
.../apache/juneau/dto/swagger/Parameter.java | 776 +++++++++++++++
.../org/apache/juneau/dto/swagger/Response.java | 194 ++++
.../org/apache/juneau/dto/swagger/Schema.java | 718 ++++++++++++++
.../juneau/dto/swagger/SecurityScheme.java | 315 ++++++
.../org/apache/juneau/dto/swagger/Swagger.java | 688 +++++++++++++
.../java/org/apache/juneau/dto/swagger/Tag.java | 121 +++
.../java/org/apache/juneau/dto/swagger/Xml.java | 173 ++++
.../org/apache/juneau/dto/swagger/package.html | 58 ++
.../java/org/apache/juneau/html/HtmlParser.java | 44 +-
.../org/apache/juneau/html/HtmlSerializer.java | 53 +-
.../juneau/html/HtmlSerializerContext.java | 15 +-
.../juneau/html/HtmlSerializerSession.java | 14 +-
.../java/org/apache/juneau/html/HtmlWriter.java | 2 +-
.../java/org/apache/juneau/ini/package.html | 4 +-
.../org/apache/juneau/internal/FileUtils.java | 100 ++
.../apache/juneau/internal/ReflectionUtils.java | 30 +
.../java/org/apache/juneau/jena/package.html | 90 +-
.../java/org/apache/juneau/json/JsonParser.java | 2 +-
.../juneau/json/JsonSchemaSerializer.java | 2 +-
.../org/apache/juneau/json/JsonSerializer.java | 4 +-
.../java/org/apache/juneau/json/package.html | 58 +-
.../apache/juneau/msgpack/MsgPackParser.java | 2 +-
.../juneau/msgpack/MsgPackSerializer.java | 2 +-
.../main/java/org/apache/juneau/package.html | 2 +-
.../java/org/apache/juneau/parser/Parser.java | 2 +-
.../java/org/apache/juneau/parser/package.html | 2 +-
.../apache/juneau/serializer/Serializer.java | 4 +-
.../org/apache/juneau/serializer/package.html | 2 +-
.../transform/AnnotationBeanFilterBuilder.java | 9 +-
.../org/apache/juneau/transform/package.html | 2 +-
.../juneau/urlencoding/UonSerializer.java | 4 +-
.../urlencoding/UrlEncodingSerializer.java | 4 +-
.../org/apache/juneau/urlencoding/package.html | 60 +-
.../java/org/apache/juneau/xml/Namespace.java | 2 +-
.../java/org/apache/juneau/xml/XmlParser.java | 2 +-
.../java/org/apache/juneau/xml/package.html | 60 +-
juneau-core/src/main/javadoc/overview.html | 237 ++---
.../java/org/apache/juneau/AnnotationsTest.java | 2 +-
.../java/org/apache/juneau/BeanConfigTest.java | 4 +-
.../juneau/a/rttests/RoundTripBeanMapsTest.java | 4 +-
.../juneau/a/rttests/RoundTripGenericsTest.java | 2 +-
.../juneau/a/rttests/RoundTripMapsTest.java | 3 +-
.../a/rttests/RoundTripReadOnlyBeansTest.java | 4 +-
.../apache/juneau/a/rttests/RoundTripTest.java | 33 +-
.../java/org/apache/juneau/html/CommonTest.java | 38 +-
.../java/org/apache/juneau/html/HtmlTest.java | 86 +-
.../java/org/apache/juneau/jena/CommonTest.java | 14 +-
.../java/org/apache/juneau/json/CommonTest.java | 14 +-
.../juneau/transforms/BeanFilterTest.java | 2 +-
.../juneau/transforms/CalendarSwapTest.java | 6 +-
.../juneau/urlencoding/Common_UonTest.java | 14 +-
.../urlencoding/Common_UrlEncodingTest.java | 14 +-
.../java/org/apache/juneau/xml/CommonTest.java | 14 +-
.../org/apache/juneau/xml/XmlCollapsedTest.java | 4 +-
.../java/org/apache/juneau/xml/XmlTest.java | 4 +-
.../microservice/sample/HelloWorldResource.java | 2 +-
.../microservice/sample/RootResources.java | 2 +-
.../microservice/sample/nls/Messages.properties | 2 +-
.../org/apache/juneau/microservice/package.html | 2 +-
.../microservice/resources/ConfigEdit.html | 2 +-
.../microservice/resources/ConfigResource.java | 47 +-
.../resources/DirectoryResource.java | 2 +-
.../microservice/resources/LogsResource.java | 16 +-
.../resources/SampleRootResource.java | 2 +-
.../resources/ShutdownResource.java | 2 +-
.../juneau/server/samples/AtomFeedResource.java | 2 +-
.../server/samples/CodeFormatterResource.java | 2 +-
.../server/samples/DockerRegistryResource.java | 4 +-
.../server/samples/JsonSchemaResource.java | 2 +-
.../server/samples/MethodExampleResource.java | 16 +-
.../juneau/server/samples/PhotosResource.java | 12 +-
.../juneau/server/samples/SourceResource.java | 2 +-
.../juneau/server/samples/SqlQueryResource.java | 2 +-
.../server/samples/TumblrParserResource.java | 2 +-
.../server/samples/UrlEncodedFormResource.java | 2 +-
.../addressbook/AddressBookResource.java | 51 +-
.../server/samples/TempDirUploadPage.html | 2 +-
.../juneau/server/samples/UrlEncodedForm.html | 2 +-
.../nls/AddressBookResource.properties | 129 +--
.../samples/nls/AtomFeedResource.properties | 2 +-
.../nls/CodeFormatterResource.properties | 2 +-
.../samples/nls/HelloWorldResource.properties | 2 +-
.../samples/nls/JsonSchemaResource.properties | 2 +-
.../nls/MethodExampleResource.properties | 42 +-
.../samples/nls/PhotosResource.properties | 2 +-
.../samples/nls/RequestEchoResource.properties | 2 +-
.../server/samples/nls/RootResources.properties | 2 +-
.../nls/SampleRemoteableServlet.properties | 2 +-
.../samples/nls/SourceResource.properties | 2 +-
.../samples/nls/SqlQueryResource.properties | 2 +-
.../samples/nls/TempDirResource.properties | 2 +-
.../samples/nls/TumblrParserResource.properties | 2 +-
.../nls/UrlEncodedFormResource.properties | 2 +-
.../server/samples/RootResourcesTest.java | 11 +-
.../server/test/AcceptCharsetResource.java | 2 +-
.../test/BeanContextPropertiesResource.java | 2 +-
.../server/test/CallbackStringsResource.java | 4 +-
.../server/test/CharsetEncodingsResource.java | 2 +-
.../juneau/server/test/ConfigResource.java | 2 +-
.../juneau/server/test/ContentResource.java | 18 +-
.../test/DefaultContentTypesResource.java | 12 +-
.../server/test/ErrorConditionsResource.java | 14 +-
.../juneau/server/test/GroupsResource.java | 6 +-
.../apache/juneau/server/test/GzipResource.java | 4 +-
.../juneau/server/test/InheritanceResource.java | 2 +-
.../juneau/server/test/LargePojosResource.java | 2 +-
.../apache/juneau/server/test/NlsResource.java | 70 +-
.../server/test/NoParserInputResource.java | 12 +-
.../juneau/server/test/OnPostCallResource.java | 2 +-
.../juneau/server/test/OnPreCallResource.java | 6 +-
.../server/test/OptionsWithoutNlsResource.java | 6 +-
.../juneau/server/test/ParamsResource.java | 86 +-
.../juneau/server/test/ParsersResource.java | 12 +-
.../juneau/server/test/PropertiesResource.java | 5 +-
.../juneau/server/test/RestClient2Resource.java | 2 +-
.../juneau/server/test/SerializersResource.java | 2 +-
.../juneau/server/test/TransformsResource.java | 8 +-
.../juneau/server/test/UrlContentResource.java | 8 +-
.../juneau/server/test/NlsResource.properties | 98 +-
.../juneau/server/test/CallbackStringsTest.java | 2 +-
.../apache/juneau/server/test/ContentTest.java | 264 ++---
.../juneau/server/test/ErrorConditionsTest.java | 4 +-
.../org/apache/juneau/server/test/NlsTest.java | 119 +--
.../juneau/server/test/NoParserInputTest.java | 6 +-
.../server/test/OptionsWithoutNlsTest.java | 6 +-
.../apache/juneau/server/test/ParamsTest.java | 26 +-
.../juneau/server/test/UrlContentTest.java | 16 +-
.../org/apache/juneau/server/RestRequest.java | 110 ++-
.../org/apache/juneau/server/RestServlet.java | 965 +++++++++++++++----
.../juneau/server/RestServletContext.java | 149 +--
.../juneau/server/RestServletDefault.java | 8 +-
.../apache/juneau/server/annotation/Attr.java | 74 --
.../apache/juneau/server/annotation/Body.java | 58 ++
.../juneau/server/annotation/Content.java | 58 --
.../juneau/server/annotation/FormData.java | 98 ++
.../juneau/server/annotation/HasFormData.java | 95 ++
.../juneau/server/annotation/HasParam.java | 95 --
.../juneau/server/annotation/HasQParam.java | 61 --
.../juneau/server/annotation/HasQuery.java | 61 ++
.../apache/juneau/server/annotation/Param.java | 98 --
.../apache/juneau/server/annotation/Path.java | 74 ++
.../apache/juneau/server/annotation/QParam.java | 94 --
.../apache/juneau/server/annotation/Query.java | 94 ++
.../juneau/server/annotation/Response.java | 24 +-
.../juneau/server/annotation/RestMethod.java | 199 ++--
.../juneau/server/annotation/RestResource.java | 236 ++++-
.../apache/juneau/server/annotation/Var.java | 116 ++-
.../juneau/server/annotation/VarCategory.java | 36 -
.../org/apache/juneau/server/jaxrs/package.html | 34 +-
.../server/jena/RestServletJenaDefault.java | 8 +-
.../juneau/server/labels/BeanDescription.java | 2 +-
.../labels/ChildResourceDescriptions.java | 2 +-
.../juneau/server/labels/DefaultLabels.java | 78 --
.../juneau/server/labels/MethodDescription.java | 350 -------
.../juneau/server/labels/NameDescription.java | 2 +-
.../juneau/server/labels/ParamDescription.java | 103 --
.../juneau/server/labels/ResourceOptions.java | 252 -----
.../org/apache/juneau/server/labels/Var.java | 87 --
.../java/org/apache/juneau/server/package.html | 182 ++--
.../server/remoteable/RemoteableServlet.java | 4 +-
.../apache/juneau/server/vars/RequestVar.java | 6 +-
.../org/apache/juneau/server/styles/devops.css | 8 +-
182 files changed, 8459 insertions(+), 3126 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
index f0225f3..8d6dc2d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
@@ -310,7 +310,7 @@ import org.apache.juneau.transform.*;
* <h6 class='topic'>Examples</h6>
* <p class='bcode'>
* <jc>// Bean class definition where only property 'name' is detected.</jc>
- * <ja>@Bean</ja>(properties={<js>"name"</js>})
+ * <ja>@Bean</ja>(properties=<js>"name"</js>)
* <jk>public class</jk> Person {
* <jk>public</jk> String getName();
* <jk>public void</jk> setName(String name);
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/BeanMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/BeanMeta.java b/juneau-core/src/main/java/org/apache/juneau/BeanMeta.java
index 6cdf591..a24461c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/BeanMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/BeanMeta.java
@@ -191,7 +191,7 @@ public class BeanMeta<T> {
if (constructor != null)
throw new BeanRuntimeException(c, "Multiple instances of '@BeanConstructor' found.");
constructor = (Constructor<T>)x;
- constructorArgs = x.getAnnotation(BeanConstructor.class).properties();
+ constructorArgs = StringUtils.split(x.getAnnotation(BeanConstructor.class).properties(), ',');
if (constructorArgs.length != x.getParameterTypes().length)
throw new BeanRuntimeException(c, "Number of properties defined in '@BeanConstructor' annotation does not match number of parameters in constructor.");
if (! setAccessible(constructor))
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/BeanPropertyMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/BeanPropertyMeta.java b/juneau-core/src/main/java/org/apache/juneau/BeanPropertyMeta.java
index 434ef46..c27b015 100644
--- a/juneau-core/src/main/java/org/apache/juneau/BeanPropertyMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/BeanPropertyMeta.java
@@ -255,8 +255,8 @@ public class BeanPropertyMeta {
isUri |= (rawTypeMeta.isUri() || field.isAnnotationPresent(org.apache.juneau.annotation.URI.class));
if (p != null) {
swap = getPropertyPojoSwap(p);
- if (p.properties().length != 0)
- properties = p.properties();
+ if (! p.properties().isEmpty())
+ properties = StringUtils.split(p.properties(), ',');
if (p.beanDictionary().length > 0)
this.beanDictionary = new BeanDictionaryBuilder().add(p.beanDictionary()).setBeanContext(beanContext).build();
}
@@ -270,8 +270,8 @@ public class BeanPropertyMeta {
if (p != null) {
if (swap == null)
swap = getPropertyPojoSwap(p);
- if (properties != null && p.properties().length != 0)
- properties = p.properties();
+ if (properties != null && ! p.properties().isEmpty())
+ properties = StringUtils.split(p.properties(), ',');
if (p.beanDictionary().length > 0)
this.beanDictionary = new BeanDictionaryBuilder().add(p.beanDictionary()).setBeanContext(beanContext).build();
}
@@ -285,8 +285,8 @@ public class BeanPropertyMeta {
if (p != null) {
if (swap == null)
swap = getPropertyPojoSwap(p);
- if (properties != null && p.properties().length != 0)
- properties = p.properties();
+ if (properties != null && ! p.properties().isEmpty())
+ properties = StringUtils.split(p.properties(), ',');
if (p.beanDictionary().length > 0)
this.beanDictionary = new BeanDictionaryBuilder().add(p.beanDictionary()).setBeanContext(beanContext).build();
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
index 9ae3788..2f735fa 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
@@ -47,7 +47,7 @@ import org.apache.juneau.utils.*;
* @author James Bognar (james.bognar@salesforce.com)
* @param <T> The class type of the wrapped class.
*/
-@Bean(properties={"innerClass","classCategory","elementType","keyType","valueType","notABeanReason","initException","beanMeta"})
+@Bean(properties="innerClass,classCategory,elementType,keyType,valueType,notABeanReason,initException,beanMeta")
public final class ClassMeta<T> implements Type {
/** Class categories. */
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/annotation/Bean.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/annotation/Bean.java b/juneau-core/src/main/java/org/apache/juneau/annotation/Bean.java
index 1d12fa1..9acee0f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/annotation/Bean.java
+++ b/juneau-core/src/main/java/org/apache/juneau/annotation/Bean.java
@@ -109,14 +109,14 @@ public @interface Bean {
* <p class='bcode'>
* <jc>// Address class with only street/city/state properties (in that order).</jc>
* <jc>// All other properties are ignored.</jc>
- * <ja>@Bean</ja>(properties={<js>"street"</js>,<js>"city"</js>,<js>"state"</js>})
+ * <ja>@Bean</ja>(properties=<js>"street,city,state"</js>)
* <jk>public class</jk> Address {
* ...
* </p>
* </dd>
* </dl>
*/
- String[] properties() default {};
+ String properties() default "";
/**
* Sort bean properties in alphabetical order.
@@ -147,14 +147,14 @@ public @interface Bean {
* <p class='bcode'>
* <jc>// Address class with only street/city/state properties (in that order).</jc>
* <jc>// All other properties are ignored.</jc>
- * <ja>@Bean</ja>(excludeProperties={<js>"city"</js>,<js>"state"</js>})
+ * <ja>@Bean</ja>(excludeProperties=<js>"city,state"</js>})
* <jk>public class</jk> Address {
* ...
* </p>
* </dd>
* </dl>
*/
- String[] excludeProperties() default {};
+ String excludeProperties() default "";
/**
* Associates a {@link PropertyNamer} with this bean to tailor the names of the bean properties.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/annotation/BeanConstructor.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/annotation/BeanConstructor.java b/juneau-core/src/main/java/org/apache/juneau/annotation/BeanConstructor.java
index ada8ec9..7395695 100644
--- a/juneau-core/src/main/java/org/apache/juneau/annotation/BeanConstructor.java
+++ b/juneau-core/src/main/java/org/apache/juneau/annotation/BeanConstructor.java
@@ -33,7 +33,7 @@ import org.apache.juneau.*;
* <jk>private final</jk> String <jf>name</jf>;
* <jk>private final int</jk> <jf>age</jf>;
*
- * <ja>@BeanConstructor</ja>(properties={<js>"name"</js>,<js>"age"</js>})
+ * <ja>@BeanConstructor</ja>(properties=<js>"name,age"</js>})
* <jk>public</jk> Person(String name, <jk>int</jk> age) {
* <jk>this</jk>.<jf>name</jf> = name;
* <jk>this</jk>.<jf>age</jf> = age;
@@ -82,5 +82,5 @@ public @interface BeanConstructor {
* <p>
* The number of properties listed must match the number of arguments in the constructor.
*/
- String[] properties() default {};
+ String properties() default "";
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/annotation/BeanProperty.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/annotation/BeanProperty.java b/juneau-core/src/main/java/org/apache/juneau/annotation/BeanProperty.java
index d5d13c8..dd0fa36 100644
--- a/juneau-core/src/main/java/org/apache/juneau/annotation/BeanProperty.java
+++ b/juneau-core/src/main/java/org/apache/juneau/annotation/BeanProperty.java
@@ -151,7 +151,7 @@ public @interface BeanProperty {
* <jk>public class</jk> MyClass {
*
* <jc>// Only render 'f1' when serializing this bean property.</jc>
- * <ja>@BeanProperty</ja>(properties={<js>"f1"</js>})
+ * <ja>@BeanProperty</ja>(properties=<js>"f1"</js>)
* <jk>public</jk> MyChildClass x1 = <jk>new</jk> MyChildClass();
* }
*
@@ -166,7 +166,7 @@ public @interface BeanProperty {
* </dd>
* </dl>
*/
- String[] properties() default {};
+ String properties() default "";
/**
* The list of classes that make up the bean dictionary for this bean property.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/annotation/Consumes.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/annotation/Consumes.java b/juneau-core/src/main/java/org/apache/juneau/annotation/Consumes.java
index 8996496..7e95a2d 100644
--- a/juneau-core/src/main/java/org/apache/juneau/annotation/Consumes.java
+++ b/juneau-core/src/main/java/org/apache/juneau/annotation/Consumes.java
@@ -37,7 +37,7 @@ import org.apache.juneau.parser.*;
* <p>
* Standard example:
* <p class='bcode'>
- * <ja>@Consumes</ja>({<js>"application/json"</js>,<js>"text/json"</js>})
+ * <ja>@Consumes</ja>(<js>"application/json,text/json"</js>)
* <jk>public class</jk> JsonParser <jk>extends</jk> ReaderParser {...}
* </p>
* <p>
@@ -45,11 +45,11 @@ import org.apache.juneau.parser.*;
* <a href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1'>RFC2616/14.1</a>.
* <p class='bcode'>
* <jc>// Consumes any text</jc>
- * <ja>@Consumes</ja>({<js>"text\/*"</js>})
+ * <ja>@Consumes</ja>(<js>"text\/*"</js>)
* <jk>public class</jk> AnythingParser <jk>extends</jk> ReaderParser {...}
*
* <jc>// Consumes anything</jc>
- * <ja>@Consumes</ja>({<js>"*\/*"</js>})
+ * <ja>@Consumes</ja>(<js>"*\/*"</js>)
* <jk>public class</jk> AnythingParser <jk>extends</jk> ReaderParser {...}
* </p>
*
@@ -63,11 +63,11 @@ import org.apache.juneau.parser.*;
public @interface Consumes {
/**
- * The media types that the parser can handle.
+ * A comma-delimited list of media types that the parser can handle.
* <p>
* Can contain meta-characters per the <code>media-type</code> specification of
* <a href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1'>RFC2616/14.1</a>
* @return The media types that the parser can handle.
*/
- String[] value() default {};
+ String value() default "";
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/annotation/Produces.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/annotation/Produces.java b/juneau-core/src/main/java/org/apache/juneau/annotation/Produces.java
index 8158a3e..3091397 100644
--- a/juneau-core/src/main/java/org/apache/juneau/annotation/Produces.java
+++ b/juneau-core/src/main/java/org/apache/juneau/annotation/Produces.java
@@ -37,7 +37,7 @@ import org.apache.juneau.serializer.*;
* <p>
* Standard example:
* <p class='bcode'>
- * <ja>@Produces</ja>({<js>"application/json"</js>,<js>"text/json"</js>})
+ * <ja>@Produces</ja>(<js>"application/json,text/json"</js>)
* <jk>public class</jk> JsonSerializer <jk>extends</jk> WriterSerializer {...}
* </p>
* <p>
@@ -66,13 +66,13 @@ import org.apache.juneau.serializer.*;
public @interface Produces {
/**
- * The media types that the serializer can handle.
+ * A comma-delimited list of the media types that the serializer can handle.
* <p>
* Can contain meta-characters per the <code>media-type</code> specification of
* <a href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1'>RFC2616/14.1</a>
* @return The media types that the parser can handle.
*/
- String[] value() default {};
+ String value() default "";
/**
* The content type that this serializer produces.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
index 0f21ab7..d5397b3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
@@ -27,7 +27,7 @@ import org.apache.juneau.xml.annotation.*;
* @author James Bognar (james.bognar@salesforce.com)
*/
@SuppressWarnings({"rawtypes","hiding"})
-@Bean(typeName="item",properties={"name","type","length"})
+@Bean(typeName="item", properties="name,type,length")
public class Column {
private String name, type;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
index 115580a..cd46bcc 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
@@ -75,7 +75,7 @@ import org.apache.juneau.xml.annotation.*;
* @author James Bognar (james.bognar@salesforce.com)
*/
@SuppressWarnings("unchecked")
-@Bean(typeName="dataset", properties={"metadata","data"})
+@Bean(typeName="dataset", properties="metadata,data")
public class DataSet {
private Column[] metaData;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
index 9196f1e..af0302f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
@@ -30,11 +30,12 @@ import org.apache.juneau.transform.*;
*/
@SuppressWarnings("hiding")
@Bean(typeName="schema",
- properties={"id","$schema","$ref", "title","description","type","definitions","properties",
- "patternProperties","dependencies","items","multipleOf","maximum","exclusiveMaximum",
- "minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems",
- "maxItems","minItems","uniqueItems","maxProperties","minProperties","required",
- "additionalProperties","enum","allOf","anyOf","oneOf","not"})
+ properties="id,$schema,$ref, title,description,type,definitions,properties,"
+ + "patternProperties,dependencies,items,multipleOf,maximum,exclusiveMaximum,"
+ + "minimum,exclusiveMinimum,maxLength,minLength,pattern,additionalItems,"
+ + "maxItems,minItems,uniqueItems,maxProperties,minProperties,required,"
+ + "additionalProperties,enum,allOf,anyOf,oneOf,not"
+)
public class Schema {
private String name; // Property name. Not serialized.
private URI id;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/package.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/package.html b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/package.html
index 7eebc86..77b0b5f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/package.html
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/package.html
@@ -449,7 +449,7 @@
* Replaces the schema document with the specified content, and then mirrors it as the response.
*/</jd>
<ja>@RestMethod</ja>(name=<js>"PUT"</js>, path=<js>"/"</js>)
- <jk>public</jk> Schema setSchema(<ja>@Content</ja> Schema schema) <jk>throws</jk> Exception {
+ <jk>public</jk> Schema setSchema(<ja>@Body</ja> Schema schema) <jk>throws</jk> Exception {
<jk>this</jk>.<jf>schema</jf> = schema;
<jk>return</jk> <jk>this</jk>.<jf>schema</jf>;
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Contact.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Contact.java b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Contact.java
new file mode 100644
index 0000000..5f0002f
--- /dev/null
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Contact.java
@@ -0,0 +1,118 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.dto.swagger;
+
+import org.apache.juneau.annotation.*;
+
+/**
+ * Contact information for the exposed API.
+ * <p>
+ * Example:
+ * <p class='bcode'>
+ * {
+ * <js>"name"</js>: <js>"API Support"</js>,
+ * <js>"url"</js>: <js>"http://www.swagger.io/support"</js>,
+ * <js>"email"</js>: <js>"support@swagger.io"</js>
+ * }
+ * </p>
+ *
+ * @author james.bognar
+ */
+@Bean(properties="name,url,email")
+public class Contact {
+
+ private String name;
+ private String url;
+ private String email;
+
+ /**
+ * Convenience method for creating a new Contact object.
+ *
+ * @return A new Contact object.
+ */
+ public static Contact create() {
+ return new Contact();
+ }
+
+ /**
+ * Bean property getter: <property>name</property>.
+ * <p>
+ * The identifying name of the contact person/organization.
+ *
+ * @return The value of the <property>name</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Bean property setter: <property>name</property>.
+ * <p>
+ * The identifying name of the contact person/organization.
+ *
+ * @param name The new value for the <property>name</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Contact setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>url</property>.
+ * <p>
+ * The URL pointing to the contact information. MUST be in the format of a URL.
+ *
+ * @return The value of the <property>url</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * Bean property setter: <property>url</property>.
+ * <p>
+ * The URL pointing to the contact information. MUST be in the format of a URL.
+ *
+ * @param url The new value for the <property>url</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Contact setUrl(String url) {
+ this.url = url;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>email</property>.
+ * <p>
+ * The email address of the contact person/organization. MUST be in the format of an email address.
+ *
+ * @return The value of the <property>email</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * Bean property setter: <property>email</property>.
+ * <p>
+ * The email address of the contact person/organization. MUST be in the format of an email address.
+ *
+ * @param email The new value for the <property>email</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Contact setEmail(String email) {
+ this.email = email;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/swagger/ExternalDocumentation.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/swagger/ExternalDocumentation.java b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/ExternalDocumentation.java
new file mode 100644
index 0000000..3a927c9
--- /dev/null
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/ExternalDocumentation.java
@@ -0,0 +1,93 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.dto.swagger;
+
+import org.apache.juneau.annotation.*;
+
+/**
+ * Allows referencing an external resource for extended documentation.
+ * <p>
+ * Example:
+ * <p class='bcode'>
+ * {
+ * <js>"description"</js>: <js>"Find more info here"</js>,
+ * <js>"url"</js>: <js>"https://swagger.io"</js>
+ * }
+ * </p>
+ *
+ * @author james.bognar
+ */
+@Bean(properties="description,url")
+public class ExternalDocumentation {
+
+ private String description;
+ private String url;
+
+ /**
+ * Convenience method for creating a new ExternalDocumentation object.
+ *
+ * @param url Required. The URL for the target documentation. Value MUST be in the format of a URL.
+ * @return A new ExternalDocumentation object.
+ */
+ public static ExternalDocumentation create(String url) {
+ return new ExternalDocumentation().setUrl(url);
+ }
+
+ /**
+ * Bean property getter: <property>description</property>.
+ * <p>
+ * A short description of the target documentation. GFM syntax can be used for rich text representation.
+ *
+ * @return The value of the <property>description</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Bean property setter: <property>description</property>.
+ * <p>
+ * A short description of the target documentation. GFM syntax can be used for rich text representation.
+ *
+ * @param description The new value for the <property>description</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public ExternalDocumentation setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>url</property>.
+ * <p>
+ * Required. The URL for the target documentation. Value MUST be in the format of a URL.
+ *
+ * @return The value of the <property>url</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * Bean property setter: <property>url</property>.
+ * <p>
+ * Required. The URL for the target documentation. Value MUST be in the format of a URL.
+ *
+ * @param url The new value for the <property>url</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public ExternalDocumentation setUrl(String url) {
+ this.url = url;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Header.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Header.java b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Header.java
new file mode 100644
index 0000000..f3d0c94
--- /dev/null
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Header.java
@@ -0,0 +1,582 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.dto.swagger;
+
+import java.util.*;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.internal.*;
+import org.apache.juneau.json.*;
+
+/**
+ * Describes a single HTTP header.
+ * <p>
+ * Example:
+ * <p class='bcode'>
+ * {
+ * <js>"description"</js>: <js>"The number of allowed requests in the current period"</js>,
+ * <js>"type"</js>: <js>"integer"</js>
+ * }
+ * </p>
+ *
+ * @author james.bognar
+ */
+@Bean(properties="description,type,format,items,collectionFormat,default,maximum,exclusiveMaximum,minimum,exclusiveMinimum,maxLength,minLength,pattern,maxItems,minItems,uniqueItems,enum,multipleOf")
+public class Header {
+
+ private static final String[] VALID_TYPES = {"string", "number", "integer", "boolean", "array"};
+ private static final String[] VALID_COLLECTION_FORMATS = {"csv","ssv","tsv","pipes","multi"};
+
+ private String description;
+ private String type;
+ private String format;
+ private Items items;
+ private String collectionFormat;
+ private Object _default;
+ private Number maximum;
+ private Boolean exclusiveMaximum;
+ private Number minimum;
+ private Boolean exclusiveMinimum;
+ private Integer maxLength;
+ private Integer minLength;
+ private String pattern;
+ private Integer maxItems;
+ private Integer minItems;
+ private Boolean uniqueItems;
+ private List<Object> _enum;
+ private Number multipleOf;
+ private boolean strict;
+
+ /**
+ * Convenience method for creating a new Header object.
+ *
+ * @param type Required. The type of the object.
+ * The value MUST be one of <js>"string"</js>, <js>"number"</js>, <js>"integer"</js>, <js>"boolean"</js>, or <js>"array"</js>.
+ * @return A new Header object.
+ */
+ public static Header create(String type) {
+ return new Header().setType(type);
+ }
+
+ /**
+ * Same as {@link #create(String)} except methods will throw runtime exceptions if you attempt
+ * to pass in invalid values per the Swagger spec.
+ *
+ * @param type Required. The type of the object.
+ * The value MUST be one of <js>"string"</js>, <js>"number"</js>, <js>"integer"</js>, <js>"boolean"</js>, or <js>"array"</js>.
+ * @return A new Header object.
+ */
+ public static Header createStrict(String type) {
+ return new Header().setStrict().setType(type);
+ }
+
+ private Header setStrict() {
+ this.strict = true;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>description</property>.
+ * <p>
+ * A short description of the header.
+ *
+ * @return The value of the <property>description</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Bean property setter: <property>description</property>.
+ * <p>
+ * A short description of the header.
+ *
+ * @param description The new value for the <property>description</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>type</property>.
+ * <p>
+ * Required. The type of the object.
+ * The value MUST be one of <js>"string"</js>, <js>"number"</js>, <js>"integer"</js>, <js>"boolean"</js>, or <js>"array"</js>.
+ *
+ * @return The value of the <property>type</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Bean property setter: <property>type</property>.
+ * <p>
+ * Required. The type of the object.
+ * The value MUST be one of <js>"string"</js>, <js>"number"</js>, <js>"integer"</js>, <js>"boolean"</js>, or <js>"array"</js>.
+ *
+ * @param type The new value for the <property>type</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setType(String type) {
+ if (strict && ! ArrayUtils.contains(type, VALID_TYPES))
+ throw new RuntimeException("Invalid value passed in to setType(String). Value='"+type+"', valid values=" + JsonSerializer.DEFAULT_LAX.toString(VALID_TYPES));
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>format</property>.
+ * <p>
+ * The extending format for the previously mentioned <code>type</code>. See <a href='http://swagger.io/specification/#dataTypeFormat'>Data Type Formats</a> for further details.
+ *
+ * @return The value of the <property>format</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getFormat() {
+ return format;
+ }
+
+ /**
+ * Bean property setter: <property>format</property>.
+ * <p>
+ * The extending format for the previously mentioned <code>type</code>. See <a href='http://swagger.io/specification/#dataTypeFormat'>Data Type Formats</a> for further details.
+ *
+ * @param format The new value for the <property>format</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setFormat(String format) {
+ this.format = format;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>items</property>.
+ * <p>
+ * Required if <code>type</code> is <js>"array"</js>.
+ * Describes the type of items in the array.
+ *
+ * @return The value of the <property>items</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Items getItems() {
+ return items;
+ }
+
+ /**
+ * Bean property setter: <property>items</property>.
+ * <p>
+ * Required if <code>type</code> is <js>"array"</js>.
+ * Describes the type of items in the array.
+ *
+ * @param items The new value for the <property>items</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setItems(Items items) {
+ this.items = items;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>collectionFormat</property>.
+ * <p>
+ * Determines the format of the array if type array is used.
+ * <p>
+ * Possible values are:
+ * <ul>
+ * <li><code>csv</code> - comma separated values <code>foo,bar</code>.
+ * <li><code>ssv</code> - space separated values <code>foo bar</code>.
+ * <li><code>tsv</code> - tab separated values <code>foo\tbar</code>.
+ * <li><code>pipes</code> - pipe separated values <code>foo|bar</code>.
+ * </ul>
+ * <p>
+ * Default value is <code>csv</code>.
+ *
+ * @return The value of the <property>collectionFormat</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getCollectionFormat() {
+ return collectionFormat;
+ }
+
+ /**
+ * Bean property setter: <property>collectionFormat</property>.
+ * <p>
+ * Determines the format of the array if type array is used.
+ * <p>
+ * Possible values are:
+ * <ul>
+ * <li><code>csv</code> - comma separated values <code>foo,bar</code>.
+ * <li><code>ssv</code> - space separated values <code>foo bar</code>.
+ * <li><code>tsv</code> - tab separated values <code>foo\tbar</code>.
+ * <li><code>pipes</code> - pipe separated values <code>foo|bar</code>.
+ * </ul>
+ * <p>
+ * Default value is <code>csv</code>.
+ *
+ * @param collectionFormat The new value for the <property>collectionFormat</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setCollectionFormat(String collectionFormat) {
+ if (strict && ! ArrayUtils.contains(collectionFormat, VALID_COLLECTION_FORMATS))
+ throw new RuntimeException("Invalid value passed in to setCollectionFormat(String). Value='"+collectionFormat+"', valid values=" + JsonSerializer.DEFAULT_LAX.toString(VALID_COLLECTION_FORMATS));
+ this.collectionFormat = collectionFormat;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>default</property>.
+ * <p>
+ * Declares the value of the header that the server will use if none is provided.
+ * (Note: <js>"default"</js> has no meaning for required items.)
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor101'>http://json-schema.org/latest/json-schema-validation.html#anchor101</a>.
+ * Unlike JSON Schema this value MUST conform to the defined <code>type</code> for the header.
+ *
+ * @return The value of the <property>_default</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Object getDefault() {
+ return _default;
+ }
+
+ /**
+ * Bean property setter: <property>default</property>.
+ * <p>
+ * Declares the value of the header that the server will use if none is provided.
+ * (Note: <js>"default"</js> has no meaning for required items.)
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor101'>http://json-schema.org/latest/json-schema-validation.html#anchor101</a>.
+ * Unlike JSON Schema this value MUST conform to the defined <code>type</code> for the header.
+ *
+ * @param _default The new value for the <property>_default</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setDefault(Object _default) {
+ this._default = _default;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>maximum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor17'>http://json-schema.org/latest/json-schema-validation.html#anchor17</a>.
+ *
+ * @return The value of the <property>maximum</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Number getMaximum() {
+ return maximum;
+ }
+
+ /**
+ * Bean property setter: <property>maximum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor17'>http://json-schema.org/latest/json-schema-validation.html#anchor17</a>.
+ *
+ * @param maximum The new value for the <property>maximum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMaximum(Number maximum) {
+ this.maximum = maximum;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>exclusiveMaximum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor17'>http://json-schema.org/latest/json-schema-validation.html#anchor17</a>.
+ *
+ * @return The value of the <property>exclusiveMaximum</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Boolean getExclusiveMaximum() {
+ return exclusiveMaximum;
+ }
+
+ /**
+ * Bean property setter: <property>exclusiveMaximum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor17'>http://json-schema.org/latest/json-schema-validation.html#anchor17</a>.
+ *
+ * @param exclusiveMaximum The new value for the <property>exclusiveMaximum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setExclusiveMaximum(Boolean exclusiveMaximum) {
+ this.exclusiveMaximum = exclusiveMaximum;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>minimum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor21'>http://json-schema.org/latest/json-schema-validation.html#anchor21</a>.
+ *
+ * @return The value of the <property>minimum</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Number getMinimum() {
+ return minimum;
+ }
+
+ /**
+ * Bean property setter: <property>minimum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor21'>http://json-schema.org/latest/json-schema-validation.html#anchor21</a>.
+ *
+ * @param minimum The new value for the <property>minimum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMinimum(Number minimum) {
+ this.minimum = minimum;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>exclusiveMinimum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor21'>http://json-schema.org/latest/json-schema-validation.html#anchor21</a>.
+ *
+ * @return The value of the <property>exclusiveMinimum</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Boolean getExclusiveMinimum() {
+ return exclusiveMinimum;
+ }
+
+ /**
+ * Bean property setter: <property>exclusiveMinimum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor21'>http://json-schema.org/latest/json-schema-validation.html#anchor21</a>.
+ *
+ * @param exclusiveMinimum The new value for the <property>exclusiveMinimum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setExclusiveMinimum(Boolean exclusiveMinimum) {
+ this.exclusiveMinimum = exclusiveMinimum;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>maxLength</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor26'>http://json-schema.org/latest/json-schema-validation.html#anchor26</a>.
+ *
+ * @return The value of the <property>maxLength</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ /**
+ * Bean property setter: <property>maxLength</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor26'>http://json-schema.org/latest/json-schema-validation.html#anchor26</a>.
+ *
+ * @param maxLength The new value for the <property>maxLength</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMaxLength(Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>minLength</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor29'>http://json-schema.org/latest/json-schema-validation.html#anchor29</a>.
+ *
+ * @return The value of the <property>minLength</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Integer getMinLength() {
+ return minLength;
+ }
+
+ /**
+ * Bean property setter: <property>minLength</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor29'>http://json-schema.org/latest/json-schema-validation.html#anchor29</a>.
+ *
+ * @param minLength The new value for the <property>minLength</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMinLength(Integer minLength) {
+ this.minLength = minLength;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>pattern</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor33'>http://json-schema.org/latest/json-schema-validation.html#anchor33</a>.
+ *
+ * @return The value of the <property>pattern</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getPattern() {
+ return pattern;
+ }
+
+ /**
+ * Bean property setter: <property>pattern</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor33'>http://json-schema.org/latest/json-schema-validation.html#anchor33</a>.
+ *
+ * @param pattern The new value for the <property>pattern</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setPattern(String pattern) {
+ this.pattern = pattern;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>maxItems</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor42'>http://json-schema.org/latest/json-schema-validation.html#anchor42</a>.
+ *
+ * @return The value of the <property>maxItems</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Integer getMaxItems() {
+ return maxItems;
+ }
+
+ /**
+ * Bean property setter: <property>maxItems</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor42'>http://json-schema.org/latest/json-schema-validation.html#anchor42</a>.
+ *
+ * @param maxItems The new value for the <property>maxItems</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMaxItems(Integer maxItems) {
+ this.maxItems = maxItems;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>minItems</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor45'>http://json-schema.org/latest/json-schema-validation.html#anchor45</a>.
+ *
+ * @return The value of the <property>minItems</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Integer getMinItems() {
+ return minItems;
+ }
+
+ /**
+ * Bean property setter: <property>minItems</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor45'>http://json-schema.org/latest/json-schema-validation.html#anchor45</a>.
+ *
+ * @param minItems The new value for the <property>minItems</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMinItems(Integer minItems) {
+ this.minItems = minItems;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>uniqueItems</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor49'>http://json-schema.org/latest/json-schema-validation.html#anchor49</a>.
+ *
+ * @return The value of the <property>uniqueItems</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Boolean getUniqueItems() {
+ return uniqueItems;
+ }
+
+ /**
+ * Bean property setter: <property>uniqueItems</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor49'>http://json-schema.org/latest/json-schema-validation.html#anchor49</a>.
+ *
+ * @param uniqueItems The new value for the <property>uniqueItems</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setUniqueItems(Boolean uniqueItems) {
+ this.uniqueItems = uniqueItems;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>enum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor76'>http://json-schema.org/latest/json-schema-validation.html#anchor76</a>.
+ *
+ * @return The value of the <property>enum</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public List<Object> getEnum() {
+ return _enum;
+ }
+
+ /**
+ * Bean property setter: <property>enum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor76'>http://json-schema.org/latest/json-schema-validation.html#anchor76</a>.
+ *
+ * @param _enum The new value for the <property>enum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setEnum(List<Object> _enum) {
+ this._enum = _enum;
+ return this;
+ }
+
+ /**
+ * Bean property adder: <property>enum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor76'>http://json-schema.org/latest/json-schema-validation.html#anchor76</a>.
+ *
+ * @param _enum The new values to add to the <property>enum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ @SuppressWarnings("hiding")
+ public Header addEnum(Object..._enum) {
+ return addEnum(Arrays.asList(_enum));
+ }
+
+ /**
+ * Bean property adder: <property>enum</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor76'>http://json-schema.org/latest/json-schema-validation.html#anchor76</a>.
+ *
+ * @param _enum The new values to add to the <property>enum</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ @SuppressWarnings("hiding")
+ public Header addEnum(Collection<Object> _enum) {
+ if (this._enum == null)
+ this._enum = new LinkedList<Object>();
+ this._enum.addAll(_enum);
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>multipleOf</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor14'>http://json-schema.org/latest/json-schema-validation.html#anchor14</a>.
+ *
+ * @return The value of the <property>multipleOf</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Number getMultipleOf() {
+ return multipleOf;
+ }
+
+ /**
+ * Bean property setter: <property>multipleOf</property>.
+ * <p>
+ * See <a href='http://json-schema.org/latest/json-schema-validation.html#anchor14'>http://json-schema.org/latest/json-schema-validation.html#anchor14</a>.
+ *
+ * @param multipleOf The new value for the <property>multipleOf</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Header setMultipleOf(Number multipleOf) {
+ this.multipleOf = multipleOf;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7f2bcfdd/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Info.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Info.java b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Info.java
new file mode 100644
index 0000000..4a9a58e
--- /dev/null
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/swagger/Info.java
@@ -0,0 +1,205 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.dto.swagger;
+
+import org.apache.juneau.annotation.*;
+
+/**
+ * The object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience.
+ * <p>
+ * Example:
+ * <p class='bcode'>
+ * {
+ * <js>"title"</js>: <js>"Swagger Sample App"</js>,
+ * <js>"description"</js>: <js>"This is a sample server Petstore server."</js>,
+ * <js>"termsOfService"</js>: <js>"http://swagger.io/terms/"</js>,
+ * <js>"contact"</js>: {
+ * <js>"name"</js>: <js>"API Support"</js>,
+ * <js>"url"</js>: <js>"http://www.swagger.io/support"</js>,
+ * <js>"email"</js>: <js>"support@swagger.io"</js>
+ * },
+ * <js>"license"</js>: {
+ * <js>"name"</js>: <js>"Apache 2.0"</js>,
+ * <js>"url"</js>: <js>"http://www.apache.org/licenses/LICENSE-2.0.html"</js>
+ * },
+ * <js>"version"</js>: <js>"1.0.1"</js>
+ * }
+ * </p>
+ *
+ * @author james.bognar
+ */
+@Bean(properties="title,description,termsOfService,contact,license,version")
+public class Info {
+
+ private String title;
+ private String description;
+ private String termsOfService;
+ private Contact contact;
+ private License license;
+ private String version;
+
+ /**
+ * Convenience method for creating a new Info object.
+ *
+ * @param title Required. The title of the application.
+ * @param version Required. Provides the version of the application API (not to be confused with the specification version).
+ * @return A new Info object.
+ */
+ public static Info create(String title, String version) {
+ return new Info().setTitle(title).setVersion(version);
+ }
+
+ /**
+ * Bean property getter: <property>title</property>.
+ * <p>
+ * Required. The title of the application.
+ *
+ * @return The value of the <property>title</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Bean property setter: <property>title</property>.
+ * <p>
+ * Required. The title of the application.
+ *
+ * @param title The new value for the <property>title</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Info setTitle(String title) {
+ this.title = title;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>description</property>.
+ * <p>
+ * A short description of the application. GFM syntax can be used for rich text representation.
+ *
+ * @return The value of the <property>description</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Bean property setter: <property>description</property>.
+ * <p>
+ * A short description of the application. GFM syntax can be used for rich text representation.
+ *
+ * @param description The new value for the <property>description</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Info setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>termsOfService</property>.
+ * <p>
+ * The Terms of Service for the API.
+ *
+ * @return The value of the <property>termsOfService</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getTermsOfService() {
+ return termsOfService;
+ }
+
+ /**
+ * Bean property setter: <property>termsOfService</property>.
+ * <p>
+ * The Terms of Service for the API.
+ *
+ * @param termsOfService The new value for the <property>termsOfService</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Info setTermsOfService(String termsOfService) {
+ this.termsOfService = termsOfService;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>contact</property>.
+ * <p>
+ * The contact information for the exposed API.
+ *
+ * @return The value of the <property>contact</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public Contact getContact() {
+ return contact;
+ }
+
+ /**
+ * Bean property setter: <property>contact</property>.
+ * <p>
+ * The contact information for the exposed API.
+ *
+ * @param contact The new value for the <property>contact</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Info setContact(Contact contact) {
+ this.contact = contact;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>license</property>.
+ * <p>
+ * The license information for the exposed API.
+ *
+ * @return The value of the <property>license</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public License getLicense() {
+ return license;
+ }
+
+ /**
+ * Bean property setter: <property>license</property>.
+ * <p>
+ * The license information for the exposed API.
+ *
+ * @param license The new value for the <property>license</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Info setLicense(License license) {
+ this.license = license;
+ return this;
+ }
+
+ /**
+ * Bean property getter: <property>version</property>.
+ * <p>
+ * Required. Provides the version of the application API (not to be confused with the specification version).
+ *
+ * @return The value of the <property>version</property> property on this bean, or <jk>null</jk> if it is not set.
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Bean property setter: <property>version</property>.
+ * <p>
+ * Required. Provides the version of the application API (not to be confused with the specification version).
+ *
+ * @param version The new value for the <property>version</property> property on this bean.
+ * @return This object (for method chaining).
+ */
+ public Info setVersion(String version) {
+ this.version = version;
+ return this;
+ }
+}