juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [juneau] branch master updated: Swagger enhancements.
Date Thu, 03 May 2018 14:29:28 GMT
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 5e0c2c4  Swagger enhancements.
5e0c2c4 is described below

commit 5e0c2c48f9f76f249dad1a69f9efbc991eaa1a4c
Author: JamesBognar <jamesbognar@apache.org>
AuthorDate: Thu May 3 10:29:12 2018 -0400

    Swagger enhancements.
---
 .../examples/rest/MethodExampleResource.java       |  4 +-
 .../apache/juneau/rest/test/FormDataResource.java  |  4 +-
 .../apache/juneau/rest/test/HeadersResource.java   |  4 +-
 .../org/apache/juneau/rest/test/QueryResource.java |  4 +-
 .../apache/juneau/rest/BasicRestInfoProvider.java  | 18 ++--
 .../org/apache/juneau/rest/RestJavaMethod.java     | 13 +--
 .../apache/juneau/rest/annotation/FormData.java    |  7 +-
 .../org/apache/juneau/rest/annotation/Header.java  |  7 +-
 .../org/apache/juneau/rest/annotation/Query.java   |  7 +-
 .../org/apache/juneau/rest/util/RestUtils.java     | 18 ++++
 .../juneau/rest/BasicRestInfoProviderTest.java     | 96 ++++++++++++++++++++++
 11 files changed, 140 insertions(+), 42 deletions(-)

diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
index 60fa7af..04e2511 100644
--- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
+++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/MethodExampleResource.java
@@ -86,11 +86,11 @@ public class MethodExampleResource extends BasicRestServlet {
 			@Path UUID p3,
 			@Query("q1") int q1,                    // Query parameters.
 			@Query("q2") String q2,
-			@Query(name="q3",def=SAMPLE_UUID_STRING) UUID q3,
+			@Query(name="q3",_default=SAMPLE_UUID_STRING) UUID q3,
 			@PathRemainder String remainder,        // Path remainder after pattern match.
 			@Header("Accept-Language") String lang, // Headers.
 			@Header("Accept") String accept,
-			@Header(name="DNT",def="1") Integer doNotTrack
+			@Header(name="DNT",_default="1") Integer doNotTrack
 		) {
 
 		// Send back a simple Map response
diff --git a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/FormDataResource.java
b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/FormDataResource.java
index 23f345c..0f61d78 100644
--- a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/FormDataResource.java
+++ b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/FormDataResource.java
@@ -59,7 +59,7 @@ public class FormDataResource extends BasicRestServlet {
 	}
 
 	@RestMethod(name=POST, path="/annotatedFormDataDefault")
-	public ObjectMap annotatedFormDataDefault(@FormData(value="f1",def="1") String f1, @FormData(value="f2",def="2")
String f2, @FormData(value="f3",def="3") String f3) {
+	public ObjectMap annotatedFormDataDefault(@FormData(value="f1",_default="1") String f1,
@FormData(value="f2",_default="2") String f2, @FormData(value="f3",_default="3") String f3)
{
 		return new ObjectMap()
 			.append("f1", f1)
 			.append("f2", f2)
@@ -67,7 +67,7 @@ public class FormDataResource extends BasicRestServlet {
 	}
 
 	@RestMethod(name=POST, path="/annotatedAndDefaultFormData", defaultFormData={"f1:1","f2=2","
f3 : 3 "})
-	public ObjectMap annotatedAndDefaultFormData(@FormData(value="f1",def="4") String f1, @FormData(value="f2",def="5")
String f2, @FormData(value="f3",def="6") String f3) {
+	public ObjectMap annotatedAndDefaultFormData(@FormData(value="f1",_default="4") String f1,
@FormData(value="f2",_default="5") String f2, @FormData(value="f3",_default="6") String f3)
{
 		return new ObjectMap()
 			.append("f1", f1)
 			.append("f2", f2)
diff --git a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/HeadersResource.java
b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/HeadersResource.java
index 4a2f4b9..e64b506 100644
--- a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/HeadersResource.java
+++ b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/HeadersResource.java
@@ -228,7 +228,7 @@ public class HeadersResource extends RestServlet {
 	}
 
 	@RestMethod(name=GET, path="/annotatedHeadersDefault")
-	public ObjectMap annotatedHeadersDefault(@Header(value="h1",def="1") String h1, @Header(value="h2",def="2")
String h2, @Header(value="h3",def="3") String h3) {
+	public ObjectMap annotatedHeadersDefault(@Header(value="h1",_default="1") String h1, @Header(value="h2",_default="2")
String h2, @Header(value="h3",_default="3") String h3) {
 		return new ObjectMap()
 			.append("h1", h1)
 			.append("h2", h2)
@@ -236,7 +236,7 @@ public class HeadersResource extends RestServlet {
 	}
 
 	@RestMethod(name=GET, path="/annotatedAndDefaultHeaders", defaultRequestHeaders={"H1:1","H2=2","
H3 : 3 "})
-	public ObjectMap annotatedAndDefaultHeaders(@Header(value="h1",def="4") String h1, @Header(value="h2",def="5")
String h2, @Header(value="h3",def="6") String h3) {
+	public ObjectMap annotatedAndDefaultHeaders(@Header(value="h1",_default="4") String h1,
@Header(value="h2",_default="5") String h2, @Header(value="h3",_default="6") String h3) {
 		return new ObjectMap()
 			.append("h1", h1)
 			.append("h2", h2)
diff --git a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/QueryResource.java
b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/QueryResource.java
index 68e412f..08acf01 100644
--- a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/QueryResource.java
+++ b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/QueryResource.java
@@ -48,7 +48,7 @@ public class QueryResource extends BasicRestServlet {
 	}
 
 	@RestMethod(name=GET, path="/annotatedQueryDefault")
-	public ObjectMap annotatedQueryDefault(@Query(value="f1",def="1") String f1, @Query(value="f2",def="2")
String f2, @Query(value="f3",def="3") String f3) {
+	public ObjectMap annotatedQueryDefault(@Query(value="f1",_default="1") String f1, @Query(value="f2",_default="2")
String f2, @Query(value="f3",_default="3") String f3) {
 		return new ObjectMap()
 			.append("f1", f1)
 			.append("f2", f2)
@@ -56,7 +56,7 @@ public class QueryResource extends BasicRestServlet {
 	}
 
 	@RestMethod(name=GET, path="/annotatedAndDefaultQuery", defaultQuery={"f1:1","f2=2"," f3
: 3 "})
-	public ObjectMap annotatedAndDefaultQuery(@Query(value="f1",def="4") String f1, @Query(value="f2",def="5")
String f2, @Query(value="f3",def="6") String f3) {
+	public ObjectMap annotatedAndDefaultQuery(@Query(value="f1",_default="4") String f1, @Query(value="f2",_default="5")
String f2, @Query(value="f3",_default="6") String f3) {
 		return new ObjectMap()
 			.append("f1", f1)
 			.append("f2", f2)
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
index fdc1101..82b35bd 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestInfoProvider.java
@@ -16,6 +16,7 @@ import static org.apache.juneau.internal.ReflectionUtils.*;
 import static org.apache.juneau.internal.StringUtils.*;
 import static org.apache.juneau.jsonschema.JsonSchemaSerializer.*;
 import static org.apache.juneau.rest.RestParamType.*;
+import static org.apache.juneau.rest.util.RestUtils.*;
 import static org.apache.juneau.serializer.OutputStreamSerializer.*;
 
 import java.lang.reflect.*;
@@ -243,7 +244,7 @@ public class BasicRestInfoProvider implements RestInfoProvider {
 		
 		String s = mb.findFirstString(locale, "tags");
 		if (s != null) {
-			for (ObjectMap m : parseList(s, vr, true, false, "Messages/tags on class {0}", c).elements(ObjectMap.class))
{
+			for (ObjectMap m : parseListOrCdl(s, vr, true, false, "Messages/tags on class {0}", c).elements(ObjectMap.class))
{
 				String name = m.getString("name");
 				if (name == null)
 					throw new SwaggerException(null, "Tag definition found without name in resource bundle
on class {0}", c) ;
@@ -352,8 +353,8 @@ public class BasicRestInfoProvider implements RestInfoProvider {
 				param.appendIf(true, true, true, "exclusiveMinimum", vr.resolve(pi.getString("exclusiveMinimum")));
 				param.appendIf(true, true, true, "uniqueItems", vr.resolve(pi.getString("uniqueItems")));
 				param.appendIf(true, true, true, "schema", parseMap(pi.getString("schema"), vr, false,
true, "ParameterInfo/schema on class {0} method {1}", c, m));
-				param.appendIf(true, true, true, "default", JsonParser.DEFAULT.parse(vr.resolve(pi.getString("default")),
Object.class));
-				param.appendIf(true, true, true, "enum", parseList(pi.getString("enum"), vr, false, true,
"ParameterInfo/enum on class {0} method {1}", c, m));
+				param.appendIf(true, true, true, "default", parseAnything(vr.resolve(pi.getString("default"))));
+				param.appendIf(true, true, true, "enum", parseListOrCdl(pi.getString("enum"), vr, false,
true, "ParameterInfo/enum on class {0} method {1}", c, m));
 				param.appendIf(true, true, true, "x-example", parseAnything(vr.resolve(pi.getString("example"))));
 				param.appendIf(true, true, true, "x-examples", parseMap(pi.getString("examples"), vr,
false, true, "ParameterInfo/examples on class {0} method {1}", c, m));
 				param.appendIf(true, true, true, "items", parseMap(pi.getString("items"), vr, false,
true, "ParameterInfo/items on class {0} method {1}", c, m));
@@ -427,7 +428,7 @@ public class BasicRestInfoProvider implements RestInfoProvider {
 						header.appendIf(true, true, true, "exclusiveMinimum", vr.resolve(pi2.getString("exclusiveMinimum")));
 						header.appendIf(true, true, true, "uniqueItems", vr.resolve(pi2.getString("uniqueItems")));
 						header.appendIf(true, true, true, "default", JsonParser.DEFAULT.parse(vr.resolve(pi2.getString("default")),
Object.class));
-						header.appendIf(true, true, true, "enum", parseList(pi2.getString("enum"), vr, false,
true, "ParameterInfo/enum on class {0} method {1}", c, m));
+						header.appendIf(true, true, true, "enum", parseListOrCdl(pi2.getString("enum"), vr,
false, true, "ParameterInfo/enum on class {0} method {1}", c, m));
 						header.appendIf(true, true, true, "x-example", parseAnything(vr.resolve(pi2.getString("example"))));
 						header.appendIf(true, true, true, "examples", parseMap(pi2.getString("examples"), vr,
false, true, "ParameterInfo/examples on class {0} method {1}", c, m));
 						header.appendIf(true, true, true, "items", parseMap(pi2.getString("items"), vr, false,
true, "ParameterInfo/items on class {0} method {1}", c, m));
@@ -525,15 +526,6 @@ public class BasicRestInfoProvider implements RestInfoProvider {
 		return swagger;
 	}
 	
-	private Object parseAnything(String s) throws ParseException {
-		if (s == null)
-			return null;
-		char c1 = StringUtils.firstNonWhitespaceChar(s), c2 = StringUtils.lastNonWhitespaceChar(s);
-		if (c1 == '{' && c2 == '}' || c1 == '[' && c2 == ']' || c1 == '\'' &&
c2 == '\'')
-			return JsonParser.DEFAULT.parse(s, Object.class);
-		return s;
-	}
-	
 	private ObjectMap parseMap(String s, VarResolverSession vs, boolean ignoreCommentsAndWhitespace,
boolean nullOnEmpty, String location, Object...locationArgs) throws ParseException {
 		try {
 			if (s == null)
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestJavaMethod.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestJavaMethod.java
index a183542..92fc1fe 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestJavaMethod.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestJavaMethod.java
@@ -19,6 +19,7 @@ import static org.apache.juneau.internal.CollectionUtils.*;
 import static org.apache.juneau.internal.StringUtils.*;
 import static org.apache.juneau.internal.Utils.*;
 import static org.apache.juneau.rest.RestContext.*;
+import static org.apache.juneau.rest.util.RestUtils.*;
 
 import java.lang.annotation.*;
 import java.lang.reflect.*;
@@ -361,16 +362,16 @@ public class RestJavaMethod implements Comparable<RestJavaMethod>
 {
 					for (Annotation a : pa[i]) {
 						if (a instanceof Header) {
 							Header h = (Header)a;
-							if (! h.def().isEmpty())
-								defaultRequestHeaders.put(firstNonEmpty(h.name(), h.value()), h.def());
+							if (h._default().length > 0)
+								defaultRequestHeaders.put(firstNonEmpty(h.name(), h.value()), parseAnything(joinnl(h._default())));
 						} else if (a instanceof Query) {
 							Query q = (Query)a;
-							if (! q.def().isEmpty())
-								defaultQuery.put(firstNonEmpty(q.name(), q.value()), q.def());
+							if (q._default().length > 0)
+								defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default())));
 						} else if (a instanceof FormData) {
 							FormData f = (FormData)a;
-							if (! f.def().isEmpty())
-								defaultFormData.put(firstNonEmpty(f.name(), f.value()), f.def());
+							if (f._default().length > 0)
+								defaultFormData.put(firstNonEmpty(f.name(), f.value()), parseAnything(joinnl(f._default())));
 						}
 					}
 				}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
index 0e3b068..b646f9a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/FormData.java
@@ -67,11 +67,6 @@ import org.apache.juneau.rest.*;
 public @interface FormData {
 
 	/**
-	 * The default value for this form-data parameter if it's not present in the request.
-	 */
-	String def() default "";
-
-	/**
 	 * Specify <jk>true</jk> if using multi-part parameters to represent collections
and arrays.
 	 * 
 	 * <p>
@@ -386,6 +381,8 @@ public @interface FormData {
 	/**
 	 * Defines the swagger value <code>/paths/{path}/{method}/parameters/#/default</code>.
 	 * 
+	 * {@link TODO Also used to set a default value in the request}
+	 * 
 	 * <h5 class='section'>Notes:</h5>
 	 * <ul class='spaced-list'>
 	 * 	<li>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
index b0225c4..f5c6bb5 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Header.java
@@ -54,11 +54,6 @@ import org.apache.juneau.rest.*;
 public @interface Header {
 
 	/**
-	 * The default value for this header if it's not present in the request.
-	 */
-	String def() default "";
-
-	/**
 	 * HTTP header name.
 	 */
 	String name() default "";
@@ -359,6 +354,8 @@ public @interface Header {
 	/**
 	 * Defines the swagger value <code>/paths/{path}/{method}/parameters/#/default</code>.
 	 * 
+	 * {@link TODO Also used to set a default value in the request}
+	 * 
 	 * <h5 class='section'>Notes:</h5>
 	 * <ul class='spaced-list'>
 	 * 	<li>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
index c95f2a3..574bcbf 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Query.java
@@ -63,11 +63,6 @@ import org.apache.juneau.rest.*;
 public @interface Query {
 
 	/**
-	 * The default value for this query parameter if it's not present in the request.
-	 */
-	String def() default "";
-
-	/**
 	 * Specify <jk>true</jk> if using multi-part parameters to represent collections
and arrays.
 	 * 
 	 * <p>
@@ -382,6 +377,8 @@ public @interface Query {
 	/**
 	 * Defines the swagger value <code>/paths/{path}/{method}/parameters/#/default</code>.
 	 * 
+	 * {@link TODO Also used to set a default value in the request}
+	 * 
 	 * <h5 class='section'>Notes:</h5>
 	 * <ul class='spaced-list'>
 	 * 	<li>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
index 27a0ba3..588ff7a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/util/RestUtils.java
@@ -21,6 +21,8 @@ import java.util.regex.*;
 import javax.servlet.http.*;
 
 import org.apache.juneau.*;
+import org.apache.juneau.internal.*;
+import org.apache.juneau.json.*;
 import org.apache.juneau.parser.*;
 import org.apache.juneau.uon.*;
 import org.apache.juneau.utils.*;
@@ -353,4 +355,20 @@ public final class RestUtils {
 			m.put(key, new String[]{val});
 		}
 	}
+	
+	/**
+	 * Parses a string that can consist of a simple string or JSON object/array.
+	 * 
+	 * @param s The string to parse.
+	 * @return The parsed value, or <jk>null</jk> if the input is null.
+	 * @throws ParseException
+	 */
+	public static Object parseAnything(String s) throws ParseException {
+		if (s == null)
+			return null;
+		char c1 = StringUtils.firstNonWhitespaceChar(s), c2 = StringUtils.lastNonWhitespaceChar(s);
+		if (c1 == '{' && c2 == '}' || c1 == '[' && c2 == ']' || c1 == '\'' &&
c2 == '\'')
+			return JsonParser.DEFAULT.parse(s, Object.class);
+		return s;
+	}
 }
diff --git a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
index fb4c115..d35e3d2 100644
--- a/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
+++ b/juneau-rest/juneau-rest-server/src/test/java/org/apache/juneau/rest/BasicRestInfoProviderTest.java
@@ -3513,6 +3513,102 @@ public class BasicRestInfoProviderTest {
 	//-----------------------------------------------------------------------------------------------------------------
 	// @Header on POJO
 	//-----------------------------------------------------------------------------------------------------------------
+	
+	@Header(name="H", _default="123")
+	public static class PA01h {}
+	
+	@RestResource()
+	public static class PA01 {
+		@RestMethod(name=GET,path="/path/{foo}")
+		public Foo doFoo(PA01h h) {
+			return null;
+		}
+	}
+
+	@Test
+	public void pa01_Header_onPojo_default() throws Exception {
+		assertObjectEquals("'123'", getSwagger(new PA01()).getPaths().get("/path/{foo}").get("get").getParameter("header",
"H").getDefault());
+	}
+	
+	@Header(name="H", _enum="A,B,C")
+	public static class PA02h {}
+	
+	@RestResource()
+	public static class PA02 {
+		@RestMethod(name=GET,path="/path/{foo}")
+		public Foo doFoo(PA02h h) {
+			return null;
+		}
+	}
+
+	@Test
+	public void pa02_Header_onPojo_enum() throws Exception {
+		assertObjectEquals("['A','B','C']", getSwagger(new PA02()).getPaths().get("/path/{foo}").get("get").getParameter("header",
"H").getEnum());
+	}
+	
+	@Header(name="H", _enum="['A','B','C']")
+	public static class PA03h {}
+	
+	@RestResource()
+	public static class PA03 {
+		@RestMethod(name=GET,path="/path/{foo}")
+		public Foo doFoo(PA03h h) {
+			return null;
+		}
+	}
+
+	@Test
+	public void pa03_Header_onPojo_enum() throws Exception {
+		assertObjectEquals("['A','B','C']", getSwagger(new PA03()).getPaths().get("/path/{foo}").get("get").getParameter("header",
"H").getEnum());
+	}
+	
+	@Header(name="H", allowEmptyValue="true")
+	public static class PA04h {}
+	
+	@RestResource()
+	public static class PA04 {
+		@RestMethod(name=GET,path="/path/{foo}")
+		public Foo doFoo(PA04h h) {
+			return null;
+		}
+	}
+
+	@Test
+	public void pa04_Header_onPojo_enum() throws Exception {
+		assertEquals(true, getSwagger(new PA04()).getPaths().get("/path/{foo}").get("get").getParameter("header",
"H").getAllowEmptyValue());
+	}
+
+	@Header(name="H", collectionFormat="A")
+	public static class PA05h {}
+	
+	@RestResource()
+	public static class PA05 {
+		@RestMethod(name=GET,path="/path/{foo}")
+		public Foo doFoo(PA05h h) {
+			return null;
+		}
+	}
+
+	@Test
+	public void pa05_Header_onPojo_collectionFormat() throws Exception {
+		assertEquals("A", getSwagger(new PA05()).getPaths().get("/path/{foo}").get("get").getParameter("header",
"H").getCollectionFormat());
+	}
+
+	@Header(name="H", _default="123")
+	public static class PA06h {}
+	
+	@RestResource()
+	public static class PA06 {
+		@RestMethod(name=GET,path="/path/{foo}")
+		public Foo doFoo(PA06h h) {
+			return null;
+		}
+	}
+
+	@Test
+	public void pa06_Header_onPojo_def() throws Exception {
+		assertEquals("123", getSwagger(new PA06()).getPaths().get("/path/{foo}").get("get").getParameter("header",
"H").getDefault().toString());
+	}
 
 	//-----------------------------------------------------------------------------------------------------------------
 	// @Header on parameter

-- 
To stop receiving notification emails like this one, please contact
jamesbognar@apache.org.

Mime
View raw message