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 43bd465 Refactor HttpPart API.
43bd465 is described below
commit 43bd465fa481fbe28adc702ba519d01ba6a2c492
Author: JamesBognar <[email protected]>
AuthorDate: Sun Apr 12 17:55:25 2020 -0400
Refactor HttpPart API.
---
.../juneau/httppart/HttpPartSchemaTest_Body.java | 22 +-
.../httppart/HttpPartSchemaTest_FormData.java | 42 ++--
.../juneau/httppart/HttpPartSchemaTest_Header.java | 42 ++--
.../juneau/httppart/HttpPartSchemaTest_Path.java | 42 ++--
.../juneau/httppart/HttpPartSchemaTest_Query.java | 42 ++--
.../httppart/HttpPartSchemaTest_Response.java | 22 +-
.../HttpPartSchemaTest_ResponseHeader.java | 42 ++--
.../juneau/httppart/HttpPartCollectionFormat.java | 69 ++++++
.../apache/juneau/httppart/HttpPartDataType.java | 74 ++++++
.../org/apache/juneau/httppart/HttpPartFormat.java | 109 +++++++++
.../org/apache/juneau/httppart/HttpPartSchema.java | 266 +++------------------
.../juneau/httppart/HttpPartSchemaBuilder.java | 20 +-
.../apache/juneau/oapi/OpenApiParserSession.java | 18 +-
.../juneau/oapi/OpenApiSerializerSession.java | 30 +--
.../org/apache/juneau/rest/RestParamDefaults.java | 4 +-
15 files changed, 449 insertions(+), 395 deletions(-)
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
index 8041424..9886591 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
@@ -179,8 +179,8 @@ public class HttpPartSchemaTest_Body {
public void a05_basic_nestedItems_onClass() throws Exception {
HttpPartSchema s = HttpPartSchema.create().apply(Body.class,
A05.class).noValidate().build();
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -198,9 +198,9 @@ public class HttpPartSchemaTest_Body {
assertEquals("c1\nc2", s.getDefault());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -216,9 +216,9 @@ public class HttpPartSchemaTest_Body {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -234,9 +234,9 @@ public class HttpPartSchemaTest_Body {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
index 18e88bb..c96199c 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
@@ -80,9 +80,9 @@ public class HttpPartSchemaTest_FormData {
public void a02_basic_onClass() throws Exception {
HttpPartSchema s =
HttpPartSchema.create().apply(FormData.class, A02.class).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -137,9 +137,9 @@ public class HttpPartSchemaTest_FormData {
ParamInfo mpi = MethodInfo.of(A03.class.getMethod("a",
String.class)).getParam(0);
HttpPartSchema s =
HttpPartSchema.create().apply(FormData.class, mpi).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -194,9 +194,9 @@ public class HttpPartSchemaTest_FormData {
ParamInfo mpi = MethodInfo.of(A04.class.getMethod("a",
A01.class)).getParam(0);
HttpPartSchema s =
HttpPartSchema.create().apply(FormData.class, mpi).noValidate().build();
assertEquals("y", s.getName());
- assertEquals(HttpPartSchema.Type.INTEGER, s.getType());
- assertEquals(HttpPartSchema.Format.INT64, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, s.getType());
+ assertEquals(HttpPartFormat.INT64, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
s.getCollectionFormat());
assertEquals(5, s.getMaximum());
assertEquals(6, s.getMinimum());
assertEquals(7, s.getMultipleOf());
@@ -297,9 +297,9 @@ public class HttpPartSchemaTest_FormData {
assertEquals("x", s.getName());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.NUMBER, items.getType());
- assertEquals(HttpPartSchema.Format.INT32, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, items.getType());
+ assertEquals(HttpPartFormat.INT32, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
items.getCollectionFormat());
assertEquals(1, items.getMaximum());
assertEquals(2, items.getMinimum());
assertEquals(3, items.getMultipleOf());
@@ -315,9 +315,9 @@ public class HttpPartSchemaTest_FormData {
assertEquals("c1\nc2", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -333,9 +333,9 @@ public class HttpPartSchemaTest_FormData {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -351,9 +351,9 @@ public class HttpPartSchemaTest_FormData {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
index ba2fccf..a49139c 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
@@ -81,9 +81,9 @@ public class HttpPartSchemaTest_Header {
public void a02_basic_onClass() throws Exception {
HttpPartSchema s = HttpPartSchema.create().apply(Header.class,
A02.class).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -138,9 +138,9 @@ public class HttpPartSchemaTest_Header {
ParamInfo mpi = MethodInfo.of(A03.class.getMethod("a",
String.class)).getParam(0);
HttpPartSchema s = HttpPartSchema.create().apply(Header.class,
mpi).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -195,9 +195,9 @@ public class HttpPartSchemaTest_Header {
ParamInfo mpi = MethodInfo.of(A04.class.getMethod("a",
A01.class)).getParam(0);
HttpPartSchema s = HttpPartSchema.create().apply(Header.class,
mpi).noValidate().build();
assertEquals("y", s.getName());
- assertEquals(HttpPartSchema.Type.INTEGER, s.getType());
- assertEquals(HttpPartSchema.Format.INT64, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, s.getType());
+ assertEquals(HttpPartFormat.INT64, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
s.getCollectionFormat());
assertEquals(5, s.getMaximum());
assertEquals(6, s.getMinimum());
assertEquals(7, s.getMultipleOf());
@@ -298,9 +298,9 @@ public class HttpPartSchemaTest_Header {
assertEquals("x", s.getName());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.NUMBER, items.getType());
- assertEquals(HttpPartSchema.Format.INT32, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, items.getType());
+ assertEquals(HttpPartFormat.INT32, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
items.getCollectionFormat());
assertEquals(1, items.getMaximum());
assertEquals(2, items.getMinimum());
assertEquals(3, items.getMultipleOf());
@@ -316,9 +316,9 @@ public class HttpPartSchemaTest_Header {
assertEquals("c1\nc2", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -334,9 +334,9 @@ public class HttpPartSchemaTest_Header {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -352,9 +352,9 @@ public class HttpPartSchemaTest_Header {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
index 7d4d142..6d90f0a 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
@@ -75,9 +75,9 @@ public class HttpPartSchemaTest_Path {
public void a02_basic_onClass() throws Exception {
HttpPartSchema s = HttpPartSchema.create().apply(Path.class,
A02.class).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -120,9 +120,9 @@ public class HttpPartSchemaTest_Path {
ParamInfo mpi = MethodInfo.of(A03.class.getMethod("a",
String.class)).getParam(0);
HttpPartSchema s = HttpPartSchema.create().apply(Path.class,
mpi).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -165,9 +165,9 @@ public class HttpPartSchemaTest_Path {
ParamInfo mpi = MethodInfo.of(A04.class.getMethod("a",
A01.class)).getParam(0);
HttpPartSchema s = HttpPartSchema.create().apply(Path.class,
mpi).noValidate().build();
assertEquals("y", s.getName());
- assertEquals(HttpPartSchema.Type.INTEGER, s.getType());
- assertEquals(HttpPartSchema.Format.INT64, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, s.getType());
+ assertEquals(HttpPartFormat.INT64, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
s.getCollectionFormat());
assertEquals(5, s.getMaximum());
assertEquals(6, s.getMinimum());
assertEquals(7, s.getMultipleOf());
@@ -262,9 +262,9 @@ public class HttpPartSchemaTest_Path {
assertEquals("x", s.getName());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.NUMBER, items.getType());
- assertEquals(HttpPartSchema.Format.INT32, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, items.getType());
+ assertEquals(HttpPartFormat.INT32, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
items.getCollectionFormat());
assertEquals(1, items.getMaximum());
assertEquals(2, items.getMinimum());
assertEquals(3, items.getMultipleOf());
@@ -280,9 +280,9 @@ public class HttpPartSchemaTest_Path {
assertEquals("c1\nc2", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -298,9 +298,9 @@ public class HttpPartSchemaTest_Path {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -316,9 +316,9 @@ public class HttpPartSchemaTest_Path {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
index a3c8ef0..ebfd54c 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
@@ -81,9 +81,9 @@ public class HttpPartSchemaTest_Query {
public void a02_basic_onClass() throws Exception {
HttpPartSchema s = HttpPartSchema.create().apply(Query.class,
A02.class).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -138,9 +138,9 @@ public class HttpPartSchemaTest_Query {
ParamInfo mpi = MethodInfo.of(A03.class.getMethod("a",
String.class)).getParam(0);
HttpPartSchema s = HttpPartSchema.create().apply(Query.class,
mpi).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -195,9 +195,9 @@ public class HttpPartSchemaTest_Query {
ParamInfo mpi = MethodInfo.of(A04.class.getMethod("a",
A01.class)).getParam(0);
HttpPartSchema s = HttpPartSchema.create().apply(Query.class,
mpi).noValidate().build();
assertEquals("y", s.getName());
- assertEquals(HttpPartSchema.Type.INTEGER, s.getType());
- assertEquals(HttpPartSchema.Format.INT64, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, s.getType());
+ assertEquals(HttpPartFormat.INT64, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
s.getCollectionFormat());
assertEquals(5, s.getMaximum());
assertEquals(6, s.getMinimum());
assertEquals(7, s.getMultipleOf());
@@ -298,9 +298,9 @@ public class HttpPartSchemaTest_Query {
assertEquals("x", s.getName());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.NUMBER, items.getType());
- assertEquals(HttpPartSchema.Format.INT32, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, items.getType());
+ assertEquals(HttpPartFormat.INT32, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
items.getCollectionFormat());
assertEquals(1, items.getMaximum());
assertEquals(2, items.getMinimum());
assertEquals(3, items.getMultipleOf());
@@ -316,9 +316,9 @@ public class HttpPartSchemaTest_Query {
assertEquals("c1\nc2", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -334,9 +334,9 @@ public class HttpPartSchemaTest_Query {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -352,9 +352,9 @@ public class HttpPartSchemaTest_Query {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
index 2079109..5a72f08 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
@@ -122,8 +122,8 @@ public class HttpPartSchemaTest_Response {
public void a05_basic_nestedItems_onClass() throws Exception {
HttpPartSchema s =
HttpPartSchema.create().apply(Response.class, A05.class).noValidate().build();
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -141,9 +141,9 @@ public class HttpPartSchemaTest_Response {
assertEquals("c1\nc2", s.getDefault());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -159,9 +159,9 @@ public class HttpPartSchemaTest_Response {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -177,9 +177,9 @@ public class HttpPartSchemaTest_Response {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
index 1980083..def1f57 100644
---
a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
+++
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
@@ -79,9 +79,9 @@ public class HttpPartSchemaTest_ResponseHeader {
public void a02_basic_onClass() throws Exception {
HttpPartSchema s =
HttpPartSchema.create().apply(ResponseHeader.class,
A02.class).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -132,9 +132,9 @@ public class HttpPartSchemaTest_ResponseHeader {
ParamInfo mpi = MethodInfo.of(A03.class.getMethod("a",
String.class)).getParam(0);
HttpPartSchema s =
HttpPartSchema.create().apply(ResponseHeader.class, mpi).noValidate().build();
assertEquals("x", s.getName());
- assertEquals(HttpPartSchema.Type.NUMBER, s.getType());
- assertEquals(HttpPartSchema.Format.INT32, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, s.getType());
+ assertEquals(HttpPartFormat.INT32, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
s.getCollectionFormat());
assertEquals(1, s.getMaximum());
assertEquals(2, s.getMinimum());
assertEquals(3, s.getMultipleOf());
@@ -185,9 +185,9 @@ public class HttpPartSchemaTest_ResponseHeader {
ParamInfo mpi = MethodInfo.of(A04.class.getMethod("a",
A01.class)).getParam(0);
HttpPartSchema s =
HttpPartSchema.create().apply(ResponseHeader.class, mpi).noValidate().build();
assertEquals("y", s.getName());
- assertEquals(HttpPartSchema.Type.INTEGER, s.getType());
- assertEquals(HttpPartSchema.Format.INT64, s.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
s.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, s.getType());
+ assertEquals(HttpPartFormat.INT64, s.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
s.getCollectionFormat());
assertEquals(5, s.getMaximum());
assertEquals(6, s.getMinimum());
assertEquals(7, s.getMultipleOf());
@@ -288,9 +288,9 @@ public class HttpPartSchemaTest_ResponseHeader {
assertEquals("x", s.getName());
HttpPartSchema items = s.getItems();
- assertEquals(HttpPartSchema.Type.NUMBER, items.getType());
- assertEquals(HttpPartSchema.Format.INT32, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.CSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.NUMBER, items.getType());
+ assertEquals(HttpPartFormat.INT32, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.CSV,
items.getCollectionFormat());
assertEquals(1, items.getMaximum());
assertEquals(2, items.getMinimum());
assertEquals(3, items.getMultipleOf());
@@ -306,9 +306,9 @@ public class HttpPartSchemaTest_ResponseHeader {
assertEquals("c1\nc2", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.INTEGER, items.getType());
- assertEquals(HttpPartSchema.Format.INT64, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.SSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.INTEGER, items.getType());
+ assertEquals(HttpPartFormat.INT64, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.SSV,
items.getCollectionFormat());
assertEquals(5, items.getMaximum());
assertEquals(6, items.getMinimum());
assertEquals(7, items.getMultipleOf());
@@ -324,9 +324,9 @@ public class HttpPartSchemaTest_ResponseHeader {
assertEquals("c3\nc4", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.STRING, items.getType());
- assertEquals(HttpPartSchema.Format.FLOAT, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.TSV,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.STRING, items.getType());
+ assertEquals(HttpPartFormat.FLOAT, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.TSV,
items.getCollectionFormat());
assertEquals(9, items.getMaximum());
assertEquals(10, items.getMinimum());
assertEquals(11, items.getMultipleOf());
@@ -342,9 +342,9 @@ public class HttpPartSchemaTest_ResponseHeader {
assertEquals("c5\nc6", items.getDefault());
items = items.getItems();
- assertEquals(HttpPartSchema.Type.ARRAY, items.getType());
- assertEquals(HttpPartSchema.Format.DOUBLE, items.getFormat());
- assertEquals(HttpPartSchema.CollectionFormat.PIPES,
items.getCollectionFormat());
+ assertEquals(HttpPartDataType.ARRAY, items.getType());
+ assertEquals(HttpPartFormat.DOUBLE, items.getFormat());
+ assertEquals(HttpPartCollectionFormat.PIPES,
items.getCollectionFormat());
assertEquals(13, items.getMaximum());
assertEquals(14, items.getMinimum());
assertEquals(15, items.getMultipleOf());
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartCollectionFormat.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartCollectionFormat.java
new file mode 100644
index 0000000..014f531
--- /dev/null
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartCollectionFormat.java
@@ -0,0 +1,69 @@
+//
***************************************************************************************************************************
+// * 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.httppart;
+
+/**
+ * Valid values for the <c>collectionFormat</c> field.
+ */
+public enum HttpPartCollectionFormat {
+
+ /**
+ * Comma-separated values (e.g. <js>"foo,bar"</js>).
+ */
+ CSV,
+
+ /**
+ * Space-separated values (e.g. <js>"foo bar"</js>).
+ */
+ SSV,
+
+ /**
+ * Tab-separated values (e.g. <js>"foo\tbar"</js>).
+ */
+ TSV,
+
+ /**
+ * Pipe-separated values (e.g. <js>"foo|bar"</js>).
+ */
+ PIPES,
+
+ /**
+ * Corresponds to multiple parameter instances instead of multiple
values for a single instance (e.g. <js>"foo=bar&foo=baz"</js>).
+ */
+ MULTI,
+
+ /**
+ * UON notation (e.g. <js>"@(foo,bar)"</js>).
+ */
+ UON,
+
+ /**
+ * Not specified.
+ */
+ NO_COLLECTION_FORMAT;
+
+ /**
+ * Create from lowercase string.
+ *
+ * @param value The enum name.
+ * @return The enum.
+ */
+ public static HttpPartCollectionFormat fromString(String value) {
+ return valueOf(value.toUpperCase());
+ }
+
+ @Override /* Object */
+ public String toString() {
+ return name().toLowerCase();
+ }
+}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartDataType.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartDataType.java
new file mode 100644
index 0000000..cf2b2ff
--- /dev/null
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartDataType.java
@@ -0,0 +1,74 @@
+//
***************************************************************************************************************************
+// * 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.httppart;
+
+/**
+ * Valid values for the <c>type</c> field.
+ */
+public enum HttpPartDataType {
+
+ /**
+ * String.
+ */
+ STRING,
+
+ /**
+ * Floating point number.
+ */
+ NUMBER,
+
+ /**
+ * Decimal number.
+ */
+ INTEGER,
+
+ /**
+ * Boolean.
+ */
+ BOOLEAN,
+
+ /**
+ * Array or collection.
+ */
+ ARRAY,
+
+ /**
+ * Map or bean.
+ */
+ OBJECT,
+
+ /**
+ * File.
+ */
+ FILE,
+
+ /**
+ * Not specified.
+ */
+ NO_TYPE;
+
+ /**
+ * Create from lowercase string.
+ *
+ * @param value The enum name.
+ * @return The enum.
+ */
+ public static HttpPartDataType fromString(String value) {
+ return valueOf(value.toUpperCase());
+ }
+
+ @Override /* Object */
+ public String toString() {
+ return name().toLowerCase();
+ }
+}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartFormat.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartFormat.java
new file mode 100644
index 0000000..c9dbcf1
--- /dev/null
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartFormat.java
@@ -0,0 +1,109 @@
+//
***************************************************************************************************************************
+// * 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.httppart;
+
+/**
+ * Valid values for the <c>format</c> field.
+ */
+public enum HttpPartFormat {
+
+ /**
+ * Signed 32 bits.
+ */
+ INT32,
+
+ /**
+ * Signed 64 bits.
+ */
+ INT64,
+
+ /**
+ * 32-bit floating point number.
+ */
+ FLOAT,
+
+ /**
+ * 64-bit floating point number.
+ */
+ DOUBLE,
+
+ /**
+ * BASE-64 encoded characters.
+ */
+ BYTE,
+
+ /**
+ * Hexadecimal encoded octets (e.g. <js>"00FF"</js>).
+ */
+ BINARY,
+
+ /**
+ * Spaced-separated hexadecimal encoded octets (e.g. <js>"00 FF"</js>).
+ */
+ BINARY_SPACED,
+
+ /**
+ * An <a
href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339
full-date</a>.
+ */
+ DATE,
+
+ /**
+ * An <a
href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339
date-time</a>.
+ */
+ DATE_TIME,
+
+ /**
+ * Used to hint UIs the input needs to be obscured.
+ */
+ PASSWORD,
+
+ /**
+ * UON notation (e.g. <js>"(foo=bar,baz=@(qux,123))"</js>).
+ */
+ UON,
+
+ /**
+ * Not specified.
+ */
+ NO_FORMAT;
+
+ /**
+ * Create from lowercase dashed name.
+ *
+ * @param value The enum name.
+ * @return The enum.
+ */
+ public static HttpPartFormat fromString(String value) {
+ value = value.toUpperCase().replace('-','_');
+ return valueOf(value);
+ }
+
+ /**
+ * Returns <jk>true</jk> if this format is in the provided list.
+ *
+ * @param list The list of formats to check against.
+ * @return <jk>true</jk> if this format is in the provided list.
+ */
+ public boolean isOneOf(HttpPartFormat...list) {
+ for (HttpPartFormat ff : list)
+ if (this == ff)
+ return true;
+ return false;
+ }
+
+ @Override /* Object */
+ public String toString() {
+ String s = name().toLowerCase().replace('_','-');
+ return s;
+ }
+}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
index 45b462c..03c050e 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
@@ -13,8 +13,8 @@
package org.apache.juneau.httppart;
import static java.util.Collections.*;
-import static org.apache.juneau.httppart.HttpPartSchema.Format.*;
-import static org.apache.juneau.httppart.HttpPartSchema.Type.*;
+import static org.apache.juneau.httppart.HttpPartDataType.*;
+import static org.apache.juneau.httppart.HttpPartFormat.*;
import static org.apache.juneau.internal.StringUtils.*;
import java.lang.annotation.*;
@@ -63,9 +63,9 @@ public class HttpPartSchema {
final Set<String> _enum;
final Map<String,HttpPartSchema> properties;
final boolean allowEmptyValue, exclusiveMaximum, exclusiveMinimum,
required, uniqueItems, skipIfEmpty;
- final CollectionFormat collectionFormat;
- final Type type;
- final Format format;
+ final HttpPartCollectionFormat collectionFormat;
+ final HttpPartDataType type;
+ final HttpPartFormat format;
final Pattern pattern;
final HttpPartSchema items, additionalProperties;
final Number maximum, minimum, multipleOf;
@@ -292,7 +292,7 @@ public class HttpPartSchema {
notAllowed.aif(exclusiveMaximum,
"exclusiveMaximum");
notAllowed.aif(exclusiveMinimum,
"exclusiveMinimum");
notAllowed.aif(uniqueItems, "uniqueItems");
- notAllowed.aif(collectionFormat !=
CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
+ notAllowed.aif(collectionFormat !=
HttpPartCollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.aif(items != null, "items");
notAllowed.aif(maximum != null, "maximum");
notAllowed.aif(minimum != null, "minimum");
@@ -300,7 +300,7 @@ public class HttpPartSchema {
notAllowed.aif(maxItems != null, "maxItems");
notAllowed.aif(minItems != null, "minItems");
notAllowed.aif(minProperties != null,
"minProperties");
- invalidFormat = ! format.isOneOf(Format.BYTE,
Format.BINARY, Format.BINARY_SPACED, Format.DATE, Format.DATE_TIME,
Format.PASSWORD, Format.UON, Format.NO_FORMAT);
+ invalidFormat = !
format.isOneOf(HttpPartFormat.BYTE, HttpPartFormat.BINARY,
HttpPartFormat.BINARY_SPACED, HttpPartFormat.DATE, HttpPartFormat.DATE_TIME,
HttpPartFormat.PASSWORD, HttpPartFormat.UON, HttpPartFormat.NO_FORMAT);
break;
}
case ARRAY: {
@@ -316,7 +316,7 @@ public class HttpPartSchema {
notAllowed.aif(minLength != null, "minLength");
notAllowed.aif(maxProperties != null,
"maxProperties");
notAllowed.aif(minProperties != null,
"minProperties");
- invalidFormat = !
format.isOneOf(Format.NO_FORMAT, Format.UON);
+ invalidFormat = !
format.isOneOf(HttpPartFormat.NO_FORMAT, HttpPartFormat.UON);
break;
}
case BOOLEAN: {
@@ -326,7 +326,7 @@ public class HttpPartSchema {
notAllowed.aif(exclusiveMaximum,
"exclusiveMaximum");
notAllowed.aif(exclusiveMinimum,
"exclusiveMinimum");
notAllowed.aif(uniqueItems, "uniqueItems");
- notAllowed.aif(collectionFormat !=
CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
+ notAllowed.aif(collectionFormat !=
HttpPartCollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.aif(pattern != null, "pattern");
notAllowed.aif(items != null, "items");
notAllowed.aif(maximum != null, "maximum");
@@ -338,7 +338,7 @@ public class HttpPartSchema {
notAllowed.aif(minItems != null, "minItems");
notAllowed.aif(minLength != null, "minLength");
notAllowed.aif(minProperties != null,
"minProperties");
- invalidFormat = !
format.isOneOf(Format.NO_FORMAT, Format.UON);
+ invalidFormat = !
format.isOneOf(HttpPartFormat.NO_FORMAT, HttpPartFormat.UON);
break;
}
case FILE: {
@@ -348,7 +348,7 @@ public class HttpPartSchema {
notAllowed.aif(properties != null,
"properties");
notAllowed.aif(additionalProperties != null,
"additionalProperties");
notAllowed.aif(uniqueItems, "uniqueItems");
- notAllowed.aif(collectionFormat !=
CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
+ notAllowed.aif(collectionFormat !=
HttpPartCollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.aif(pattern != null, "pattern");
notAllowed.aif(items != null, "items");
notAllowed.aif(maxItems != null, "maxItems");
@@ -357,14 +357,14 @@ public class HttpPartSchema {
notAllowed.aif(minItems != null, "minItems");
notAllowed.aif(minLength != null, "minLength");
notAllowed.aif(minProperties != null,
"minProperties");
- invalidFormat = !
format.isOneOf(Format.NO_FORMAT, Format.UON, Format.INT32, Format.INT64);
+ invalidFormat = !
format.isOneOf(HttpPartFormat.NO_FORMAT, HttpPartFormat.UON,
HttpPartFormat.INT32, HttpPartFormat.INT64);
break;
}
case NUMBER: {
notAllowed.aif(properties != null,
"properties");
notAllowed.aif(additionalProperties != null,
"additionalProperties");
notAllowed.aif(uniqueItems, "uniqueItems");
- notAllowed.aif(collectionFormat !=
CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
+ notAllowed.aif(collectionFormat !=
HttpPartCollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.aif(pattern != null, "pattern");
notAllowed.aif(items != null, "items");
notAllowed.aif(maxItems != null, "maxItems");
@@ -373,14 +373,14 @@ public class HttpPartSchema {
notAllowed.aif(minItems != null, "minItems");
notAllowed.aif(minLength != null, "minLength");
notAllowed.aif(minProperties != null,
"minProperties");
- invalidFormat = !
format.isOneOf(Format.NO_FORMAT, Format.UON, Format.FLOAT, Format.DOUBLE);
+ invalidFormat = !
format.isOneOf(HttpPartFormat.NO_FORMAT, HttpPartFormat.UON,
HttpPartFormat.FLOAT, HttpPartFormat.DOUBLE);
break;
}
case OBJECT: {
notAllowed.aif(exclusiveMaximum,
"exclusiveMaximum");
notAllowed.aif(exclusiveMinimum,
"exclusiveMinimum");
notAllowed.aif(uniqueItems, "uniqueItems");
- notAllowed.aif(collectionFormat !=
CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
+ notAllowed.aif(collectionFormat !=
HttpPartCollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.aif(pattern != null, "pattern");
notAllowed.aif(items != null, "items");
notAllowed.aif(maximum != null, "maximum");
@@ -390,7 +390,7 @@ public class HttpPartSchema {
notAllowed.aif(maxLength != null, "maxLength");
notAllowed.aif(minItems != null, "minItems");
notAllowed.aif(minLength != null, "minLength");
- invalidFormat = !
format.isOneOf(Format.NO_FORMAT, Format.UON);
+ invalidFormat = !
format.isOneOf(HttpPartFormat.NO_FORMAT, HttpPartFormat.UON);
break;
}
default:
@@ -427,7 +427,7 @@ public class HttpPartSchema {
errors.add("minProperties cannot be less than zero.");
if (maxProperties != null && maxProperties < 0)
errors.add("maxProperties cannot be less than zero.");
- if (type == ARRAY && items != null && items.getType() == OBJECT
&& (format != UON && format != Format.NO_FORMAT))
+ if (type == ARRAY && items != null && items.getType() == OBJECT
&& (format != UON && format != HttpPartFormat.NO_FORMAT))
errors.add("Cannot define an array of objects unless
array format is 'uon'.");
if (! errors.isEmpty())
@@ -435,202 +435,6 @@ public class HttpPartSchema {
}
/**
- * Valid values for the <c>collectionFormat</c> field.
- */
- public static enum CollectionFormat {
-
- /**
- * Comma-separated values (e.g. <js>"foo,bar"</js>).
- */
- CSV,
-
- /**
- * Space-separated values (e.g. <js>"foo bar"</js>).
- */
- SSV,
-
- /**
- * Tab-separated values (e.g. <js>"foo\tbar"</js>).
- */
- TSV,
-
- /**
- * Pipe-separated values (e.g. <js>"foo|bar"</js>).
- */
- PIPES,
-
- /**
- * Corresponds to multiple parameter instances instead of
multiple values for a single instance (e.g. <js>"foo=bar&foo=baz"</js>).
- */
- MULTI,
-
- /**
- * UON notation (e.g. <js>"@(foo,bar)"</js>).
- */
- UON,
-
- /**
- * Not specified.
- */
- NO_COLLECTION_FORMAT;
-
- static CollectionFormat fromString(String value) {
-
- return valueOf(value.toUpperCase());
- }
-
- @Override
- public String toString() {
- return name().toLowerCase();
- }
- }
-
- /**
- * Valid values for the <c>type</c> field.
- */
- public static enum Type {
-
- /**
- * String.
- */
- STRING,
-
- /**
- * Floating point number.
- */
- NUMBER,
-
- /**
- * Decimal number.
- */
- INTEGER,
-
- /**
- * Boolean.
- */
- BOOLEAN,
-
- /**
- * Array or collection.
- */
- ARRAY,
-
- /**
- * Map or bean.
- */
- OBJECT,
-
- /**
- * File.
- */
- FILE,
-
- /**
- * Not specified.
- */
- NO_TYPE;
-
- static Type fromString(String value) {
- return valueOf(value.toUpperCase());
- }
-
- @Override
- public String toString() {
- return name().toLowerCase();
- }
- }
-
- /**
- * Valid values for the <c>format</c> field.
- */
- public static enum Format {
-
- /**
- * Signed 32 bits.
- */
- INT32,
-
- /**
- * Signed 64 bits.
- */
- INT64,
-
- /**
- * 32-bit floating point number.
- */
- FLOAT,
-
- /**
- * 64-bit floating point number.
- */
- DOUBLE,
-
- /**
- * BASE-64 encoded characters.
- */
- BYTE,
-
- /**
- * Hexadecimal encoded octets (e.g. <js>"00FF"</js>).
- */
- BINARY,
-
- /**
- * Spaced-separated hexadecimal encoded octets (e.g. <js>"00
FF"</js>).
- */
- BINARY_SPACED,
-
- /**
- * An <a
href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339
full-date</a>.
- */
- DATE,
-
- /**
- * An <a
href='http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14'>RFC3339
date-time</a>.
- */
- DATE_TIME,
-
- /**
- * Used to hint UIs the input needs to be obscured.
- */
- PASSWORD,
-
- /**
- * UON notation (e.g. <js>"(foo=bar,baz=@(qux,123))"</js>).
- */
- UON,
-
- /**
- * Not specified.
- */
- NO_FORMAT;
-
- static Format fromString(String value) {
- value = value.toUpperCase().replace('-','_');
- return valueOf(value);
- }
-
- @Override
- public String toString() {
- String s = name().toLowerCase().replace('_','-');
- return s;
- }
-
- /**
- * Returns <jk>true</jk> if this format is in the provided list.
- *
- * @param list The list of formats to check against.
- * @return <jk>true</jk> if this format is in the provided list.
- */
- public boolean isOneOf(Format...list) {
- for (Format ff : list)
- if (this == ff)
- return true;
- return false;
- }
- }
-
- /**
* Returns the default parsed type for this schema.
*
* @return The default parsed type for this schema. Never
<jk>null</jk>.
@@ -698,7 +502,7 @@ public class HttpPartSchema {
* @return The <c>type</c> field of this schema, or <jk>null</jk> if
not specified.
* @see HttpPartSchemaBuilder#type(String)
*/
- public Type getType() {
+ public HttpPartDataType getType() {
return type;
}
@@ -711,21 +515,21 @@ public class HttpPartSchema {
* @return The format field of this schema, or <jk>null</jk> if not
specified.
* @see HttpPartSchemaBuilder#format(String)
*/
- public Type getType(ClassMeta<?> cm) {
- if (type != Type.NO_TYPE)
+ public HttpPartDataType getType(ClassMeta<?> cm) {
+ if (type != HttpPartDataType.NO_TYPE)
return type;
if (cm.isMapOrBean())
- return Type.OBJECT;
+ return HttpPartDataType.OBJECT;
if (cm.isCollectionOrArray())
- return Type.ARRAY;
+ return HttpPartDataType.ARRAY;
if (cm.isNumber()) {
if (cm.isDecimal())
- return Type.NUMBER;
- return Type.INTEGER;
+ return HttpPartDataType.NUMBER;
+ return HttpPartDataType.INTEGER;
}
if (cm.isBoolean())
- return Type.BOOLEAN;
- return Type.STRING;
+ return HttpPartDataType.BOOLEAN;
+ return HttpPartDataType.STRING;
}
/**
@@ -744,7 +548,7 @@ public class HttpPartSchema {
* @return The <c>collectionFormat</c> field of this schema, or
<jk>null</jk> if not specified.
* @see HttpPartSchemaBuilder#collectionFormat(String)
*/
- public CollectionFormat getCollectionFormat() {
+ public HttpPartCollectionFormat getCollectionFormat() {
return collectionFormat;
}
@@ -754,7 +558,7 @@ public class HttpPartSchema {
* @see HttpPartSchemaBuilder#format(String)
* @return The <c>format</c> field of this schema, or <jk>null</jk> if
not specified.
*/
- public Format getFormat() {
+ public HttpPartFormat getFormat() {
return format;
}
@@ -767,18 +571,18 @@ public class HttpPartSchema {
* @return The <c>format</c> field of this schema, or <jk>null</jk> if
not specified.
* @see HttpPartSchemaBuilder#format(String)
*/
- public Format getFormat(ClassMeta<?> cm) {
- if (format != Format.NO_FORMAT)
+ public HttpPartFormat getFormat(ClassMeta<?> cm) {
+ if (format != HttpPartFormat.NO_FORMAT)
return format;
if (cm.isNumber()) {
if (cm.isDecimal()) {
if (cm.isDouble())
- return Format.DOUBLE;
- return Format.FLOAT;
+ return HttpPartFormat.DOUBLE;
+ return HttpPartFormat.FLOAT;
}
if (cm.isLong())
- return Format.INT64;
- return Format.INT32;
+ return HttpPartFormat.INT64;
+ return HttpPartFormat.INT32;
}
return format;
}
@@ -1326,7 +1130,7 @@ public class HttpPartSchema {
.asf("required", required)
.asf("uniqueItems", uniqueItems)
.asf("skipIfEmpty", skipIfEmpty)
- .aif(collectionFormat !=
CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat", collectionFormat)
+ .aif(collectionFormat !=
HttpPartCollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat",
collectionFormat)
.ase("pattern", pattern)
.asn("items", items)
.asn("additionalProperties",
additionalProperties)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
index 49f4e9d..0a40881 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
@@ -25,8 +25,6 @@ import org.apache.juneau.jsonschema.annotation.Schema;
import org.apache.juneau.jsonschema.annotation.Items;
import org.apache.juneau.jsonschema.annotation.SubItems;
import org.apache.juneau.reflect.*;
-import org.apache.juneau.httppart.HttpPartSchema.*;
-import org.apache.juneau.httppart.HttpPartSchema.Type;
/**
* The builder class for creating {@link HttpPartSchema} objects.
@@ -37,9 +35,9 @@ public class HttpPartSchemaBuilder {
Set<Integer> codes;
Set<String> _enum;
Boolean allowEmptyValue, exclusiveMaximum, exclusiveMinimum, required,
uniqueItems, skipIfEmpty;
- CollectionFormat collectionFormat =
CollectionFormat.NO_COLLECTION_FORMAT;
- Type type = Type.NO_TYPE;
- Format format = Format.NO_FORMAT;
+ HttpPartCollectionFormat collectionFormat =
HttpPartCollectionFormat.NO_COLLECTION_FORMAT;
+ HttpPartDataType type = HttpPartDataType.NO_TYPE;
+ HttpPartFormat format = HttpPartFormat.NO_FORMAT;
Pattern pattern;
Number maximum, minimum, multipleOf;
Long maxLength, minLength, maxItems, minItems, maxProperties,
minProperties;
@@ -575,9 +573,9 @@ public class HttpPartSchemaBuilder {
public HttpPartSchemaBuilder type(String value) {
try {
if (isNotEmpty(value))
- type = Type.fromString(value);
+ type = HttpPartDataType.fromString(value);
} catch (Exception e) {
- throw new ContextRuntimeException("Invalid value
''{0}'' passed in as type value. Valid values: {1}", value, Type.values());
+ throw new ContextRuntimeException("Invalid value
''{0}'' passed in as type value. Valid values: {1}", value,
HttpPartDataType.values());
}
return this;
}
@@ -651,9 +649,9 @@ public class HttpPartSchemaBuilder {
public HttpPartSchemaBuilder format(String value) {
try {
if (isNotEmpty(value))
- format = Format.fromString(value);
+ format = HttpPartFormat.fromString(value);
} catch (Exception e) {
- throw new ContextRuntimeException("Invalid value
''{0}'' passed in as format value. Valid values: {1}", value, Format.values());
+ throw new ContextRuntimeException("Invalid value
''{0}'' passed in as format value. Valid values: {1}", value,
HttpPartFormat.values());
}
return this;
}
@@ -801,9 +799,9 @@ public class HttpPartSchemaBuilder {
public HttpPartSchemaBuilder collectionFormat(String value) {
try {
if (isNotEmpty(value))
- this.collectionFormat =
CollectionFormat.fromString(value);
+ this.collectionFormat =
HttpPartCollectionFormat.fromString(value);
} catch (Exception e) {
- throw new ContextRuntimeException("Invalid value
''{0}'' passed in as collectionFormat value. Valid values: {1}", value,
CollectionFormat.values());
+ throw new ContextRuntimeException("Invalid value
''{0}'' passed in as collectionFormat value. Valid values: {1}", value,
HttpPartCollectionFormat.values());
}
return this;
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParserSession.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParserSession.java
index e3638ef..8aaa4ab 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParserSession.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParserSession.java
@@ -13,9 +13,9 @@
package org.apache.juneau.oapi;
import static org.apache.juneau.internal.StringUtils.*;
-import static org.apache.juneau.httppart.HttpPartSchema.Type.*;
-import static org.apache.juneau.httppart.HttpPartSchema.Format.*;
-import static org.apache.juneau.httppart.HttpPartSchema.CollectionFormat.*;
+import static org.apache.juneau.httppart.HttpPartCollectionFormat.*;
+import static org.apache.juneau.httppart.HttpPartDataType.*;
+import static org.apache.juneau.httppart.HttpPartFormat.*;
import java.util.*;
@@ -100,8 +100,8 @@ public class OpenApiParserSession extends UonParserSession {
return null;
in = schema.getDefault();
} else {
- HttpPartSchema.Type t = schema.getType(type);
- HttpPartSchema.Format f = schema.getFormat(type);
+ HttpPartDataType t = schema.getType(type);
+ HttpPartFormat f = schema.getFormat(type);
if (t == STRING) {
if (type.isObject()) {
@@ -113,7 +113,7 @@ public class OpenApiParserSession extends UonParserSession {
return (T)fromHex(in);
if (f == BINARY_SPACED)
return (T)fromSpacedHex(in);
- if (f == HttpPartSchema.Format.UON)
+ if (f == HttpPartFormat.UON)
return super.parse(partType,
schema, in, type);
return (T)in;
}
@@ -125,7 +125,7 @@ public class OpenApiParserSession extends UonParserSession {
return toType(fromHex(in), type);
if (f == BINARY_SPACED)
return toType(fromSpacedHex(in), type);
- if (f == HttpPartSchema.Format.UON)
+ if (f == HttpPartFormat.UON)
return super.parse(partType, schema,
in, type);
return toType(in, type);
@@ -137,7 +137,7 @@ public class OpenApiParserSession extends UonParserSession {
if (eType == null)
eType =
schema.getParsedType().getElementType();
- HttpPartSchema.CollectionFormat cf =
schema.getCollectionFormat();
+ HttpPartCollectionFormat cf =
schema.getCollectionFormat();
String[] ss = new String[0];
if (cf == MULTI)
@@ -150,7 +150,7 @@ public class OpenApiParserSession extends UonParserSession {
ss = splitQuoted(in);
else if (cf == TSV)
ss = split(in, '\t');
- else if (cf ==
HttpPartSchema.CollectionFormat.UON)
+ else if (cf == HttpPartCollectionFormat.UON)
return super.parse(partType, null, in,
type);
else if (cf == NO_COLLECTION_FORMAT) {
if (firstNonWhitespaceChar(in) == '@'
&& lastNonWhitespaceChar(in) == ')')
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
index 8d7453d..0786e94 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
@@ -12,9 +12,9 @@
//
***************************************************************************************************************************
package org.apache.juneau.oapi;
-import static org.apache.juneau.httppart.HttpPartSchema.CollectionFormat.*;
-import static org.apache.juneau.httppart.HttpPartSchema.Format.*;
-import static org.apache.juneau.httppart.HttpPartSchema.Type.*;
+import static org.apache.juneau.httppart.HttpPartCollectionFormat.*;
+import static org.apache.juneau.httppart.HttpPartDataType.*;
+import static org.apache.juneau.httppart.HttpPartFormat.*;
import static org.apache.juneau.internal.StringUtils.*;
import java.io.IOException;
@@ -94,9 +94,9 @@ public class OpenApiSerializerSession extends
UonSerializerSession {
ClassMeta<?> type = getClassMetaForObject(value);
if (type == null)
type = object();
- HttpPartSchema.Type t = schema.getType(type);
- HttpPartSchema.Format f = schema.getFormat(type);
- HttpPartSchema.CollectionFormat cf =
schema.getCollectionFormat();
+ HttpPartDataType t = schema.getType(type);
+ HttpPartFormat f = schema.getFormat(type);
+ HttpPartCollectionFormat cf = schema.getCollectionFormat();
String out = null;
@@ -126,14 +126,14 @@ public class OpenApiSerializerSession extends
UonSerializerSession {
out = toIsoDate(toType(value,
CM_Calendar));
else if (f == DATE_TIME)
out = toIsoDateTime(toType(value,
CM_Calendar));
- else if (f == HttpPartSchema.Format.UON)
+ else if (f == HttpPartFormat.UON)
out = super.serialize(partType, schema,
value);
else
out = toType(value, string());
} else if (t == ARRAY) {
- if (cf == HttpPartSchema.CollectionFormat.UON)
+ if (cf == HttpPartCollectionFormat.UON)
out = super.serialize(partType, null,
toList(partType, type, value, schema));
else {
List<String> l = new ArrayList<>();
@@ -165,14 +165,14 @@ public class OpenApiSerializerSession extends
UonSerializerSession {
} else if (t == BOOLEAN) {
- if (f == HttpPartSchema.Format.UON)
+ if (f == HttpPartFormat.UON)
out = super.serialize(partType, null,
value);
else
out = stringify(toType(value,
CM_Boolean));
} else if (t == INTEGER) {
- if (f == HttpPartSchema.Format.UON)
+ if (f == HttpPartFormat.UON)
out = super.serialize(partType, null,
value);
else if (f == INT64)
out = stringify(toType(value, CM_Long));
@@ -181,7 +181,7 @@ public class OpenApiSerializerSession extends
UonSerializerSession {
} else if (t == NUMBER) {
- if (f == HttpPartSchema.Format.UON)
+ if (f == HttpPartFormat.UON)
out = super.serialize(partType, null,
value);
else if (f == DOUBLE)
out = stringify(toType(value,
CM_Double));
@@ -190,7 +190,7 @@ public class OpenApiSerializerSession extends
UonSerializerSession {
} else if (t == OBJECT) {
- if (f == HttpPartSchema.Format.UON) {
+ if (f == HttpPartFormat.UON) {
out = super.serialize(partType, null,
value);
} else if (schema.hasProperties() &&
type.isMapOrBean()) {
out = super.serialize(partType, null,
toMap(partType, type, value, schema));
@@ -264,9 +264,9 @@ public class OpenApiSerializerSession extends
UonSerializerSession {
if (s == null)
s = DEFAULT_SCHEMA;
ClassMeta cm = getClassMetaForObject(o);
- HttpPartSchema.Type t = s.getType(cm);
- HttpPartSchema.Format f = s.getFormat(cm);
- HttpPartSchema.CollectionFormat cf = s.getCollectionFormat();
+ HttpPartDataType t = s.getType(cm);
+ HttpPartFormat f = s.getFormat(cm);
+ HttpPartCollectionFormat cf = s.getCollectionFormat();
if (t == STRING) {
if (f == BYTE)
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 24df668..aea195d 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
@@ -457,7 +457,7 @@ class RestParamDefaults {
super(FORM_DATA, mpi, getName(mpi));
this.schema = HttpPartSchema.create(FormData.class,
mpi);
this.partParser = createPartParser(schema.getParser(),
ps);
- this.multi = getMulti(mpi) ||
schema.getCollectionFormat() == HttpPartSchema.CollectionFormat.MULTI;
+ this.multi = getMulti(mpi) ||
schema.getCollectionFormat() == HttpPartCollectionFormat.MULTI;
if (multi && ! isCollection(type))
throw new InternalServerError("Use of multipart
flag on @FormData parameter that's not an array or Collection on method
''{0}''", mpi.getMethod());
@@ -500,7 +500,7 @@ class RestParamDefaults {
super(QUERY, mpi, getName(mpi));
this.schema = HttpPartSchema.create(Query.class, mpi);
this.partParser = createPartParser(schema.getParser(),
ps);
- this.multi = getMulti(mpi) ||
schema.getCollectionFormat() == HttpPartSchema.CollectionFormat.MULTI;
+ this.multi = getMulti(mpi) ||
schema.getCollectionFormat() == HttpPartCollectionFormat.MULTI;
if (multi && ! isCollection(type))
throw new InternalServerError("Use of multipart
flag on @Query parameter that's not an array or Collection on method ''{0}''",
mpi.getMethod());