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 a0845cb Swagger UI enhancements. a0845cb is described below commit a0845cb4e677267af4ff080ca2f6c7c487dc3fd7 Author: JamesBognar <jamesbog...@apache.org> AuthorDate: Thu Apr 12 14:54:34 2018 -0400 Swagger UI enhancements. --- .../apache/juneau/examples/rest/DirectoryResource.java | 11 +++++++++-- .../juneau/examples/rest/SampleRemoteableServlet.java | 16 +++++++++++++--- .../java/org/apache/juneau/rest/BasicRestServlet.java | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/DirectoryResource.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/DirectoryResource.java index 86477aa..4db5a15 100644 --- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/DirectoryResource.java +++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/DirectoryResource.java @@ -101,7 +101,12 @@ public class DirectoryResource extends BasicRestServlet { path="/*", summary="Get file or directory information", description="Returns information about a file or directory.", - converters={Queryable.class} + converters={Queryable.class}, + swagger={ + "parameters:[", + Queryable.SWAGGER_PARAMS, + "]" + } ) public Object doGet(RestRequest req, RequestProperties properties) throws NotFound, InternalServerError { @@ -140,7 +145,7 @@ public class DirectoryResource extends BasicRestServlet { description="Delete a file on the file system.", guards=AdminGuard.class ) - public Object doDelete(RestRequest req) throws MethodNotAllowed { + public Object doDelete(RestRequest req) throws MethodNotAllowed, Forbidden { if (! allowDeletes) throw new MethodNotAllowed("DELETE not enabled"); @@ -150,6 +155,7 @@ public class DirectoryResource extends BasicRestServlet { if (req.getHeader("Accept").contains("text/html")) return new Redirect(); + return "File deleted"; } @@ -176,6 +182,7 @@ public class DirectoryResource extends BasicRestServlet { if (req.getContentType().contains("html")) return new Redirect(parentSubPath); + return "File added"; } diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/SampleRemoteableServlet.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/SampleRemoteableServlet.java index 7418523..c62fd99 100644 --- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/SampleRemoteableServlet.java +++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/SampleRemoteableServlet.java @@ -79,7 +79,11 @@ public class SampleRemoteableServlet extends RemoteableServlet { //----------------------------------------------------------------------------------------------------------------- @Override /* RemoteableServlet */ - @RestMethod(name=GET, path="/", + @RestMethod( + name=GET, + path="/", + summary="List of available remoteable interfaces", + description="Shows a list of the interfaces registered with this remoteable servlet.", htmldoc=@HtmlDoc( aside={ "<div style='max-width:400px;min-width:200px' class='text'>", @@ -97,7 +101,10 @@ public class SampleRemoteableServlet extends RemoteableServlet { } @Override /* RemoteableServlet */ - @RestMethod(name=GET, path="/{javaInterface}", summary="List of available methods on $RP{javaInterface}.", + @RestMethod( + name=GET, + path="/{javaInterface}", + summary="List of available methods on $CO{{$RP{javaInterface},an interface}", htmldoc=@HtmlDoc( aside={ "<div style='max-width:400px;min-width:200px' class='text'>", @@ -112,7 +119,10 @@ public class SampleRemoteableServlet extends RemoteableServlet { } @Override /* RemoteableServlet */ - @RestMethod(name=GET, path="/{javaInterface}/{javaMethod}", summary="Form entry for method $RP{javaMethod} on interface $RP{javaInterface}", + @RestMethod( + name=GET, + path="/{javaInterface}/{javaMethod}", + summary="Form entry for $CO{$RP{javaMethod},method} on $CO{$RP{javaInterface},interface}", htmldoc=@HtmlDoc( aside={ "<div style='max-width:400px;min-width:200px' class='text'>", diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java index 34dc46e..556da39 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicRestServlet.java @@ -185,7 +185,7 @@ import org.apache.juneau.xmlschema.*; @Property(name=JSONSCHEMA_addExamplesTo, value="bean,collection,array,map"), // Don't generate schema information on the Swagger bean itself. - @Property(name=INFOPROVIDER_ignoreTypes, value="Swagger") + @Property(name=INFOPROVIDER_ignoreTypes, value="Swagger,org.apache.juneau.dto.html5.*") }, flags={ JSONSCHEMA_useBeanDefs -- To stop receiving notification emails like this one, please contact jamesbog...@apache.org.