| <!-- |
| /*************************************************************************************************************************** |
| * 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. |
| ***************************************************************************************************************************/ |
| --> |
| |
| 7.2.1 (Sept 25, 2018) |
| |
| <p> |
| 7.2.1 is a major release that introduces several significant new features: |
| </p> |
| <ul class='spaced-list'> |
| <li>OpenAPI part serializing and parsing with full support for OpenAPI validation of input and output in the REST servlet and client APIs. |
| <li>Swagger UI. |
| <li>New HTTP-Part annotations that are applicable to both the servlet and client APIs. |
| <li>Serverless servlet and client unit testing. |
| <li>Simplified UI customization. |
| <li>Marshalls that combines serializers and parsers into a single API. |
| </ul> |
| |
| <h5 class='topic w800'>juneau-marshall</h5> |
| <ul class='spaced-list'> |
| <li> |
| The REST client <ja>@Remoteable</ja> annotations and REST server <ja>@RemoteMethod</ja> annotations which used to be |
| in separate packages in the client and server projects have been combined into a single set of annotations in |
| the {@link oaj.http.annotation} package. |
| <br>This fixes a long-standing problem where it was easy to mix up using client-side annotations in server-side code, and vis-versa. |
| <br>Additionally, much work has been done on these annotations to add support for Swagger-style validations and documentation. |
| <ul class='doctree'> |
| <li class='ja'>{@link oaj.http.annotation.Body} |
| <li class='ja'>{@link oaj.http.annotation.FormData} |
| <li class='ja'>{@link oaj.http.annotation.Header} |
| <li class='ja'>{@link oaj.http.annotation.Path} |
| <li class='ja'>{@link oaj.http.annotation.Query} |
| <li class='ja'>{@link oaj.http.annotation.HasFormData} |
| <li class='ja'>{@link oaj.http.annotation.HasQuery} |
| <li class='ja'>{@link oaj.http.annotation.Request} |
| </ul> |
| <br>These are used with new Swagger schema/documentation annotations to produce schema-based serialization/parsing/validation |
| and auto-generated Swagger documentation: |
| <ul class='doctree'> |
| <li class='ja'>{@link oaj.http.annotation.Contact} |
| <li class='ja'><code><del>ExternalDocs</del></code> |
| <li class='ja'><code><del>Items</del></code> |
| <li class='ja'>{@link oaj.http.annotation.License} |
| <li class='ja'><code><del>Schema</del></code> |
| <li class='ja'><code><del>SubItems</del></code> |
| <li class='ja'>{@link oaj.http.annotation.Tag} |
| </ul> |
| <br>Additionally, the <ja>@Remoteable</ja> annotation has been split into the following two annotations: |
| <ul class='doctree'> |
| <li class='ja'>{@link oaj.remote.RemoteInterface} |
| - Used for remote proxy interfaces served up through |
| <code><del>RemoteInterfaceServlet</del></code> or REST <js>"PROXY"</js> methods. |
| <br>Defaults to <js>"POST"</js> with method signatures as paths. |
| <li class='ja'>{@link oajrc.remote.RemoteResource} |
| - Used for 3rd-party REST interfaces. |
| <br>Defaults to <js>"GET"</js> with standardized naming conventions for paths. |
| </ul> |
| <li> |
| Support for multi-valued parameters as maps or beans on server-side annotations (it was previously supported on client-side): |
| <code><ja>@Query</ja>(<js>"*"</js>)</code>, <code><ja>@FormData</ja>(<js>"*"</js>)</code>, <code><ja>@Header</ja>(<js>"*"</js>)</code>, <code><ja>@Path</ja>(<js>"*"</js>)</code> |
| <li> |
| Support for server-side use of <ja>@Request</ja> annotation on <ja>@RestMethod</ja> annotations and new {@link oajr.RestRequest#getRequest(RequestBeanMeta)} method. |
| <li> |
| Fixed bug where <code><ja>@Bean</ja>(typeName)</code> was not being detected on non-bean POJO classes. |
| <li> |
| Fixed bug where HTML-Schema was not being rendered correctly. |
| <li> |
| Support for POJO examples: |
| <ul class='doctree'> |
| <li class='jf'>{@link oaj.BeanContext#BEAN_examples} |
| <li class='ja'>{@link oaj.annotation.Example} |
| </ul> |
| <li> |
| Fixed bug where parsers could report the wrong line number when an error occurred. |
| <li> |
| A runtime exception is now thrown if you define a <code><ja>@BeanProperty</ja>(name)</code> but forget to |
| add it to your <code><ja>@Bean</ja>(properties)</code> annotation. |
| <li> |
| <code><ja>@Html</ja>(asXml)</code> and <code><ja>@Html</ja>(asPlainText)</code> replaced with |
| {@link oaj.html.annotation.Html#format() @Html(format)}. |
| <li> |
| HTML serializer will now serializers beans and maps as HTML even when those objects are embedded |
| within an object with <code><ja>@Html</ja>(format=<jsf>XML</jsf>)</code>. |
| <br>The previous behavior was to serialize it as XML. |
| <li> |
| New settings for binary-based serializers and parsers: |
| <ul class='doctree'> |
| <li class='jf'>{@link oaj.serializer.OutputStreamSerializer#OSSERIALIZER_binaryFormat} |
| <li class='jf'>{@link oaj.parser.InputStreamParser#ISPARSER_binaryFormat} |
| </ul> |
| <li> |
| Added support for auto-detection of fluent-style setters: |
| <ul class='doctree'> |
| <li class='jf'>{@link oaj.BeanContext#BEAN_fluentSetters} |
| <li class='ja'>{@link oaj.annotation.Bean#fluentSetters()} |
| </ul> |
| <li> |
| The <jsf>SERIALIZER_abridged</jsf> setting has been replaced with {@link oaj.serializer.Serializer#SERIALIZER_addRootType SERIALIZER_addRootType} |
| <li> |
| The <jsf>SERIALIZER_addBeanTypeProperties</jsf> setting has been replaced with {@link oaj.serializer.Serializer#SERIALIZER_addBeanTypes SERIALIZER_addBeanTypes} |
| and is disabled by default. |
| <li> |
| Parse exception messages are now clearer and include code snippets of where a parse exception occurred: |
| <p class='bcode w800' style='color:red'> |
| org.apache.juneau.parser.ParseException: Expected '[' at beginning of JSON array. |
| At line 80, column 20. |
| While parsing into: |
| currentClass: List<String> |
| currentProperty: required: java.util.List, field=[null], getter=[public java.util.List org.apache.juneau.dto.swagger.SchemaInfo.getRequired()], setter=[public org.apache.juneau.dto.swagger.SchemaInfo org.apache.juneau.dto.swagger.SchemaInfo.setRequired(java.util.Collection)] |
| ---start-- |
| 0075: "name": "body", |
| 0076: "description": "Pet object that needs to be added to the store", |
| 0077: "required": true, |
| 0078: "schema": { |
| 0079: "required": true, |
| 0080: } |
| 0081: } |
| 0082: ], |
| 0083: "responses": { |
| 0084: "405": { |
| 0085: "description": "Invalid input" |
| ---end--- |
| </p> |
| <li> |
| New property {@link oaj.parser.Parser#PARSER_debugOutputLines} for controlling how many input lines are added to the exception message above. |
| <li> |
| New property {@link oaj.BeanContext#BEAN_useEnumNames} for controlling whether enums are serialized |
| using their name or the <code>toString()</code> method. |
| <li> |
| New property {@link oaj.BeanContext#BEAN_examples} for defining examples of POJOs. |
| <li> |
| New {@link oaj.annotation.Example @Example} annotation for defining examples of POJOs. |
| <br>Used heavily in JSON-Schema support. |
| <li> |
| If a bean has both a <code>getX()</code> and <code>isX()</code> method, the <code>getX()</code> method takes precedence. |
| <br>The previous behavior was arbitrary. |
| <li> |
| Significant improvements to JSON-Schema serialization support. |
| <ul> |
| <li>New <code><del>@JsonSchema</del></code> annotation. |
| </ul> |
| <li> |
| Fixed <code>NullPointerException</code> when serializing beans with a dyna-property (i.e. <code><ja>@Bean</ja>(<js>"*"</js>)</code>) |
| which returns a <jk>null</jk> value. |
| <li> |
| New option for dyna-property (i.e. <code><ja>@Bean</ja>(<js>"*"</js>)</code>) using a method that returns a collection of extra keys. |
| <br>See new options #4 on {@link oaj.annotation.BeanProperty#name()} |
| <li> |
| New formats for the {@link oaj.html.annotation.Html#format() @Html(format)} annotation: |
| <ul class='doctree'> |
| <li class='jf'>{@link oaj.html.annotation.HtmlFormat#HTML_CDC} - Format collections as comma-delimited lists. |
| <li class='jf'>{@link oaj.html.annotation.HtmlFormat#HTML_SDC} - Format collections as space-delimited lists. |
| </ul> |
| <li> |
| Serializers now allow for q-values on the media types they handle. |
| <br>For example, the accept media type on <code>JsonSerializer.Simple</code> is <js>"application/json+simple,application/json;q=0.9"</js>. |
| <br>This means the serializer CAN handle requests for <js>"application/json"</js> if no other serializers provide a better match. |
| <li> |
| New methods for creating unmodifiable {@link oaj.ObjectMap ObjectMaps} and {@link oaj.ObjectList ObjectLists}. |
| <ul class='doctree'> |
| <li class='jc'>{@link oaj.ObjectMap} |
| <ul> |
| <li class='jm'>{@link oaj.ObjectMap#isUnmodifiable() isUnmodifable()} |
| <li class='jm'>{@link oaj.ObjectMap#unmodifiable() unmodifiable()} |
| <li class='jm'>{@link oaj.ObjectMap#modifiable() modifiable()} |
| </ul> |
| <li class='jp'>{@link oaj.ObjectList} |
| <ul> |
| <li class='jm'>{@link oaj.ObjectList#isUnmodifiable() isUnmodifable()} |
| <li class='jm'>{@link oaj.ObjectList#unmodifiable() unmodifiable()} |
| <li class='jm'>{@link oaj.ObjectList#modifiable() modifiable()} |
| </ul> |
| </ul> |
| <li> |
| The <code>JsonSerializer.Simple</code> class has been moved into the top-level {@link oaj.json.SimpleJsonSerializer} class. |
| <li> |
| RDF serializer subclasses have been moved into top-level classes: |
| <ul> |
| <li><code>RdfSerializer.Xml</code> -> {@link oaj.jena.RdfXmlSerializer} |
| <li><code>RdfSerializer.XmlAbbrev</code> -> {@link oaj.jena.RdfXmlAbbrevSerializer} |
| <li><code>RdfSerializer.N3</code> -> {@link oaj.jena.N3Serializer} |
| <li><code>RdfSerializer.NTriple</code> -> {@link oaj.jena.NTripleSerializer} |
| <li><code>RdfSerializer.Turtle</code> -> {@link oaj.jena.TurtleSerializer} |
| <li><code>RdfParser.Xml</code> -> {@link oaj.jena.RdfXmlParser} |
| <li><code>RdfParser.N3</code> -> {@link oaj.jena.N3Parser} |
| <li><code>RdfParser.NTriple</code> -> {@link oaj.jena.NTripleParser} |
| <li><code>RdfParser.Turtle</code> -> {@link oaj.jena.TurtleParser} |
| </ul> |
| <li> |
| New API for pairing serializers and parsers for simplified syntax: |
| <h5 class='figure'>Examples:</h5> |
| <p class='bpcode w800'> |
| <jc>// Using instance.</jc> |
| Json json = <jk>new</jk> Json(); |
| MyPojo myPojo = json.read(string, MyPojo.<jk>class</jk>); |
| String string = json.write(myPojo); |
| </p> |
| <p class='bpcode w800'> |
| <jc>// Using DEFAULT instance.</jc> |
| MyPojo myPojo = Json.<jsf>DEFAULT</jsf>.read(string, MyPojo.<jk>class</jk>); |
| String string = Json.<jsf>DEFAULT</jsf>.write(myPojo); |
| </p> |
| <ul class='doctree'> |
| <li class='jac'>{@link oaj.marshall.Marshall} |
| <ul> |
| <li class='jac'>{@link oaj.marshall.CharMarshall} |
| <ul> |
| <li class='jc'>{@link oaj.marshall.Html} |
| <li class='jc'>{@link oaj.marshall.Json} |
| <li class='jc'>{@link oaj.marshall.PlainText} |
| <li class='jc'>{@link oaj.marshall.SimpleJson} |
| <li class='jc'>{@link oaj.marshall.Uon} |
| <li class='jc'>{@link oaj.marshall.UrlEncoding} |
| <li class='jc'>{@link oaj.marshall.Xml} |
| <li class='jc'>{@link oaj.marshall.N3} |
| <li class='jc'>{@link oaj.marshall.NTriple} |
| <li class='jc'>{@link oaj.marshall.RdfXml} |
| <li class='jc'>{@link oaj.marshall.RdfXmlAbbrev} |
| <li class='jc'>{@link oaj.marshall.Turtle} |
| </ul> |
| <li class='jac'>{@link oaj.marshall.StreamMarshall} |
| <ul> |
| <li class='jc'>{@link oaj.marshall.Jso} |
| <li class='jc'>{@link oaj.marshall.MsgPack} |
| </ul> |
| </ul> |
| </ul> |
| <li> |
| New/updated documentation: |
| <ul> |
| <li><a href='#juneau-marshall.JsonDetails.SimplifiedJson'>2.15.3 - Simplified JSON</a> |
| </ul> |
| </ul> |
| |
| <h5 class='topic w800'>juneau-dto</h5> |
| <ul class='spaced-list'> |
| <li> |
| Fixed bug where Swagger {@link oaj.dto.swagger.SchemaInfo#required(Object...)} was defined as a boolean |
| instead of a list of strings. |
| <li> |
| Boolean attributes are now handled correctly for HTML5. |
| <br>For example, calling <code><jk>new</jk> Select().disabled(<jk>true</jk>)</code> will produce <code><select disabled='disabled'></code> |
| </ul> |
| |
| <h5 class='topic w800'>juneau-rest-server</h5> |
| <ul class='spaced-list'> |
| <li> |
| Auto-generated {@doc juneau-rest-server.Swagger Swagger UI}. |
| <li> |
| Simplified {@link oajr.annotation.RestResource#swagger() @RestResource(swagger)} |
| and {@link oajr.annotation.RestMethod#swagger() @RestMethod(swagger)} annotations. |
| <li> |
| Fixed bug in <code>UriResolver</code> when request path info had special characters. |
| <li> |
| Fixed bug where incorrect media type was being set on responses (e.g. <code>text/html+schema</code> instead of <code>text/html</code> for schema documents). |
| <li> |
| The <code>RemoteableServlet</code> class has been moved and renamed to <code><del>RemoteInterfaceServlet</del></code>. |
| <li> |
| <code><del>RemoteInterfaceServlet</del></code> now provides a form page for invoking remote interface methods in a browser. |
| <li> |
| Newlines were being stripped from <code><ja>@HtmlDoc</ja>(script)</code> when serialized which could cause script lines to become commented out. |
| <li> |
| New {@link oaj.http.annotation.Response @Response} annotation that can be applied to |
| throwables thrown from REST methods and POJOs returned by REST methods to specify non-200 status return codes and descriptions in Swagger documentation. |
| <li> |
| Swagger fields added to the following annotations: |
| <ul class='doctree'> |
| <li class='ja'>{@link oaj.http.annotation.Body} |
| <li class='ja'>{@link oaj.http.annotation.FormData} |
| <li class='ja'>{@link oaj.http.annotation.Header} |
| <li class='ja'>{@link oaj.http.annotation.Path} |
| <li class='ja'>{@link oaj.http.annotation.Query} |
| </ul> |
| <li> |
| The <ja>@PathRemainder</ja> annotation has been removed entirely. |
| <br>Use <code><ja>@Path</ja>(<js>"/*"</js>)</code> to access the path remainder which includes all the new OpenAPI parsing support. |
| <li> |
| "Helper" classes (i.e. reusable beans that can be returned by REST methods) have been moved to the following package with some new additions: |
| <ul class='doctree'> |
| <li class='jp'>{@link oajr.helper} |
| <ul> |
| <li class='jc'>{@link oajr.helper.BeanDescription} |
| <li class='jc'>{@link oajr.helper.ChildResourceDescriptions} |
| <li class='jc'><code><del>ReaderResource</del></code> |
| <li class='jc'><code><del>ReaderResourceBuilder</del></code> |
| <li class='jc'>{@link oajr.helper.SeeOtherRoot} |
| <li class='jc'>{@link oajr.helper.ResourceDescription} |
| <li class='jc'><code><del>StreamResource</del></code> |
| <li class='jc'><code><del>StreamResourceBuilder</del></code> |
| </ul> |
| </ul> |
| <li> |
| Predefined HTTP responses. |
| <ul class='doctree'> |
| <li class='jp'>{@link oajr.response} |
| <ul> |
| <li class='jc'>{@link oajr.response.Accepted} |
| <li class='jc'>{@link oajr.response.AlreadyReported} |
| <li class='jc'>{@link oajr.response.Continue} |
| <li class='jc'>{@link oajr.response.Created} |
| <li class='jc'>{@link oajr.response.EarlyHints} |
| <li class='jc'>{@link oajr.response.Found} |
| <li class='jc'>{@link oajr.response.IMUsed} |
| <li class='jc'>{@link oajr.response.MovedPermanently} |
| <li class='jc'>{@link oajr.response.MultipleChoices} |
| <li class='jc'>{@link oajr.response.MultiStatus} |
| <li class='jc'>{@link oajr.response.NoContent} |
| <li class='jc'>{@link oajr.response.NonAuthoritiveInformation} |
| <li class='jc'>{@link oajr.response.NotModified} |
| <li class='jc'>{@link oajr.response.Ok} |
| <li class='jc'>{@link oajr.response.PartialContent} |
| <li class='jc'>{@link oajr.response.PermanentRedirect} |
| <li class='jc'>{@link oajr.response.Processing} |
| <li class='jc'>{@link oajr.response.ResetContent} |
| <li class='jc'>{@link oajr.response.SeeOther} |
| <li class='jc'>{@link oajr.response.SwitchingProtocols} |
| <li class='jc'>{@link oajr.response.TemporaryRedirect} |
| <li class='jc'>{@link oajr.response.UseProxy} |
| </ul> |
| </ul> |
| <li> |
| Predefined HTTP error throwables. |
| <br>When added to REST Java methods, reflected in generated Swagger documentation. |
| <ul class='doctree'> |
| <li class='jp'>{@link oajr.exception} |
| <ul> |
| <li class='jc'>{@link oajr.exception.BadRequest} |
| <li class='jc'>{@link oajr.exception.Conflict} |
| <li class='jc'>{@link oajr.exception.ExpectationFailed} |
| <li class='jc'>{@link oajr.exception.FailedDependency} |
| <li class='jc'>{@link oajr.exception.Forbidden} |
| <li class='jc'>{@link oajr.exception.Gone} |
| <li class='jc'>{@link oajr.exception.HttpVersionNotSupported} |
| <li class='jc'>{@link oajr.exception.InsufficientStorage} |
| <li class='jc'>{@link oajr.exception.InternalServerError} |
| <li class='jc'>{@link oajr.exception.LengthRequired} |
| <li class='jc'>{@link oajr.exception.Locked} |
| <li class='jc'>{@link oajr.exception.LoopDetected} |
| <li class='jc'>{@link oajr.exception.MethodNotAllowed} |
| <li class='jc'>{@link oajr.exception.MisdirectedRequest} |
| <li class='jc'>{@link oajr.exception.NetworkAuthenticationRequired} |
| <li class='jc'>{@link oajr.exception.NotAcceptable} |
| <li class='jc'>{@link oajr.exception.NotExtended} |
| <li class='jc'>{@link oajr.exception.NotFound} |
| <li class='jc'>{@link oajr.exception.NotImplemented} |
| <li class='jc'>{@link oajr.exception.PayloadTooLarge} |
| <li class='jc'>{@link oajr.exception.PreconditionFailed} |
| <li class='jc'>{@link oajr.exception.PreconditionRequired} |
| <li class='jc'>{@link oajr.exception.RangeNotSatisfiable} |
| <li class='jc'>{@link oajr.exception.RequestHeaderFieldsTooLarge} |
| <li class='jc'>{@link oajr.exception.ServiceUnavailable} |
| <li class='jc'>{@link oajr.exception.TooManyRequests} |
| <li class='jc'>{@link oajr.exception.Unauthorized} |
| <li class='jc'>{@link oajr.exception.UnavailableForLegalReasons} |
| <li class='jc'>{@link oajr.exception.UnprocessableEntity} |
| <li class='jc'>{@link oajr.exception.UnsupportedMediaType} |
| <li class='jc'>{@link oajr.exception.UpgradeRequired} |
| <li class='jc'>{@link oajr.exception.UriTooLong} |
| <li class='jc'>{@link oajr.exception.VariantAlsoNegotiates} |
| </ul> |
| </ul> |
| <li> |
| The {@link oajr.annotation.HtmlDoc#nav() @HtmlDoc(nav)} and {@link oajr.annotation.HtmlDoc#navlinks() @HtmlDoc(navlinks)} |
| can now both be used on the same annotation. |
| <br>The contents of <code>nav()</code> are free-form HTML that gets rendered immediately after the navigation links. |
| <li> |
| The following new parameter types can be used on REST methods: |
| <ul class='doctree'> |
| <li class='jc'>{@link oaj.parser.ReaderParser} - The reader parser matching the request content type. |
| <li class='jc'>{@link oaj.parser.InputStreamParser} - The input stream parser matching the request content type. |
| </ul> |
| <li> |
| The <code>$F</code> variable can now be used as a initialization time variable. |
| <br>For example, the <code>AtomFeedResource</code> example pulls a bean example from a file on the classpath: |
| <p class='bcode w800'> |
| <ja>@RestResource</ja>( |
| path=<js>"/atom"</js>, |
| title=<js>"Sample ATOM feed resource"</js>, |
| properties={ |
| <ja>@Property</ja>(name=<jsf>BEAN_examples</jsf>, value=<js>"{'org.apache.juneau.dto.atom.Feed': $F{AtomFeedResource_example.json}}"</js>) |
| }, |
| ... |
| ) |
| </p> |
| <br>It should be noted that you cannot use the <code>$F</code> variable to retrieve localized versions of files (since you're not within |
| the scope of a client request. |
| <li> |
| The <code><del>RestResource.nowrap()</del></code> annotation has been changed to a string with a default value of <js>"true"</js>. |
| <br>Having it as a string allows us to differentiate between a set and unset value so that it can be overridden in subclasses. |
| <li> |
| The {@link oaj.http.annotation.Path#name()} annotation parameter is now required. |
| <li> |
| New class for mock unit testing of REST resources: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajr.mock.MockRest} |
| </ul> |
| <li> |
| <code><ja>@RestMethod</ja>(inherit)</code> annotation has been removed and replaced with the following classes: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajr.Inherit} |
| <li class='jc'>{@link oajr.None} |
| </ul> |
| <br>These can be used in the following locations: |
| <ul class='doctree'> |
| <li class='ja'>{@link oajr.annotation.RestResource#serializers()} |
| <li class='ja'>{@link oajr.annotation.RestResource#parsers()} |
| <li class='ja'>{@link oajr.annotation.RestResource#beanFilters()} |
| <li class='ja'>{@link oajr.annotation.RestResource#pojoSwaps()} |
| <li class='ja'>{@link oajr.annotation.RestMethod#serializers()} |
| <li class='ja'>{@link oajr.annotation.RestMethod#parsers()} |
| <li class='ja'>{@link oajr.annotation.RestMethod#beanFilters()} |
| <li class='ja'>{@link oajr.annotation.RestMethod#pojoSwaps()} |
| </ul> |
| <br>One advantage is that you now have control over the precedence of serializers and parsers by where you insert the <code>Inherit</code> class. |
| <li> |
| <code>RequestPathMatch</code> class has been renamed to {@link oajr.RequestPath}. |
| <li> |
| {@link oaj.http.annotation.Request @Request} objects can now be used as parameters in <ja>@RestMethod</ja> methods. |
| <br>Includes new methods on {@link oajr.RestRequest}: |
| <ul class='doctree'> |
| <li class='jm'>{@link oajr.RestRequest#getRequest(Class) getRequest(Class)} |
| <li class='jm'>{@link oajr.RestRequest#getRequest(RequestBeanMeta) getRequest(RequestBeanMeta)} |
| </ul> |
| <li> |
| New methods added to {@link oajr.widget.MenuItemWidget} to allow population of menu item content using Javascript and Ajax calls: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajr.widget.MenuItemWidget} |
| <ul> |
| <li class='jm'>{@link oajr.widget.MenuItemWidget#getBeforeShowScript(RestRequest) getBeforeShowScript(RestRequest)} |
| <li class='jm'>{@link oajr.widget.MenuItemWidget#getAfterShowScript(RestRequest) getAfterShowScript(RestRequest)} |
| </ul> |
| </ul> |
| <li> |
| New methods added to {@link oajr.widget.Widget} to allow retrieving classpath resources with embedded SVL variables: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajr.widget.Widget} |
| <ul> |
| <li class='jm'>{@link oajr.widget.Widget#loadHtmlWithVars(RestRequest,String) loadHtmlWithVars(RestRequest,String)} |
| <li class='jm'>{@link oajr.widget.Widget#loadScriptWithVars(RestRequest,String) loadScriptWithVars(RestRequest,String)} |
| <li class='jm'>{@link oajr.widget.Widget#loadStyleWithVars(RestRequest,String) loadStyleWithVars(RestRequest,String)} |
| </ul> |
| </ul> |
| <li> |
| New/updated documentation: |
| <br>{@doc juneau-rest-server.UnitTesting} |
| <li> |
| The behavior of the default values for {@link oajr.annotation.RestMethod#name()} and {@link oajr.annotation.RestMethod#path()} |
| have changed. |
| <br>If not specified, the values are inferred from the Java method name. |
| <br>See Also: {@doc juneau-rest-server.RestMethod} |
| <li> |
| <code>RedirectToServletRoot</code> class has been renamed to {@link oajr.helper.SeeOtherRoot}. |
| <li> |
| New REST context settings: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajr.RestContext} |
| <ul> |
| <li class='jf'>{@link oajr.RestContext#REST_uriAuthority REST_uriAuthority} |
| <li class='jf'>{@link oajr.RestContext#REST_uriContext REST_uriContext} |
| <li class='jf'>{@link oajr.RestContext#REST_uriRelativity REST_uriRelativity} |
| <li class='jf'>{@link oajr.RestContext#REST_uriResolution REST_uriResolution} |
| </ul> |
| </ul> |
| <li> |
| New convenience annotations for specifying default <code>Accept</code> and <code>Content-Type</code> headers: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajr.annotation.RestResource} |
| <ul> |
| <li class='jf'>{@link oajr.annotation.RestResource#defaultAccept defaultAccept} |
| <li class='jf'>{@link oajr.annotation.RestResource#defaultContentType defaultContentType} |
| </ul> |
| <li class='jc'>{@link oajr.annotation.RestMethod} |
| <ul> |
| <li class='jf'>{@link oajr.annotation.RestMethod#defaultAccept defaultAccept} |
| <li class='jf'>{@link oajr.annotation.RestMethod#defaultContentType defaultContentType} |
| </ul> |
| </ul> |
| </ul> |
| |
| <h5 class='topic w800'>juneau-rest-client</h5> |
| <ul class='spaced-list'> |
| <li> |
| Remote Resource interfaces support OpenAPI annotations. |
| <li> |
| Made improvements to the builder API for defining SSL support. |
| <br>New methods added: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajrc.RestClientBuilder} |
| <ul> |
| <li class='jf'>{@link oajrc.RestClientBuilder#sslProtocols(String...) sslProtocols(String...)} |
| <li class='jf'>{@link oajrc.RestClientBuilder#cipherSuites(String...) cipherSuites(String...)} |
| <li class='jf'>{@link oajrc.RestClientBuilder#hostnameVerifier(HostnameVerifier) hostnameVerifier(HostnameVerifier)} |
| <li class='jf'>{@link oajrc.RestClientBuilder#keyManagers(KeyManager...) keyManagers(KeyManager...)} |
| <li class='jf'>{@link oajrc.RestClientBuilder#trustManagers(TrustManager...)} |
| <li class='jf'>{@link oajrc.RestClientBuilder#secureRandom(SecureRandom)} |
| <li class='jf'>{@link oajrc.RestClientBuilder#httpClientConnectionManager(HttpClientConnectionManager)} |
| </ul> |
| </ul> |
| <li> |
| Clients no longer have JSON defined as the default serializer and parser. |
| <br>Instead, the clients can now be used with no serializer/parser if you're working with InputStreams/Readers or |
| POJOs that can be converted to Strings and converted from Strings/InputStreams/Readers. |
| <li> |
| Methods added to client builder to make it easy to define the transport language: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajrc.RestClientBuilder} |
| <ul> |
| <li class='jf'>{@link oajrc.RestClientBuilder#json() json()} |
| <li class='jf'>{@link oajrc.RestClientBuilder#xml() xml()} |
| <li class='jf'>{@link oajrc.RestClientBuilder#html() html()} |
| <li class='jf'>{@link oajrc.RestClientBuilder#uon() uon()} |
| <li class='jf'>{@link oajrc.RestClientBuilder#urlEnc() urlEnc()} |
| <li class='jf'>{@link oajrc.RestClientBuilder#msgpack() msgpack()} |
| <li class='jf'>{@link oajrc.RestClientBuilder#plainText() plainText()} |
| </ul> |
| </ul> |
| <li> |
| New method added for allowing serverless client testing against REST interfaces. |
| <ul class='doctree'> |
| <li class='jc'>{@link oajrc.RestClientBuilder} |
| <ul> |
| <li class='jf'>{@link oajrc.RestClientBuilder#mockHttpConnection(MockHttpConnection) mockHttpConnection(MockHttpConnection)} |
| </ul> |
| </ul> |
| <li> |
| Removed the deprecated <code>RestCall.execute()</code> method. |
| <br>Use {@link oajrc.RestCall#run()}. |
| <li> |
| <code>RestCall.input(Object)</code> method renamed to {@link oajrc.RestCall#body(Object)} to match OpenAPI terminology. |
| <li> |
| Made constructors on <code>RestClient</code> and <code>RestClientBuilder</code> protected so that they can be subclassed. |
| <li> |
| The <code>RestClient.getRemoteableProxy()</code> methods have been split into separate methods for Remote Interfaces and Remote Resources: |
| <ul class='doctree'> |
| <li class='jc'>{@link oajrc.RestClient} |
| <ul> |
| <li class='jm'><code><del>RestClient.getRemoteInterface(Class)</del></code> |
| <li class='jm'><code><del>RestClient.getRemoteInterface(Class,Object)</del></code> |
| <li class='jm'><code><del>RestClient.getRemoteInterface(Class,Object,Serializer,Parser)</del></code> |
| <li class='jm'>{@link oajrc.RestClient#getRemoteResource(Class)} |
| <li class='jm'>{@link oajrc.RestClient#getRemoteResource(Class,Object)} |
| <li class='jm'>{@link oajrc.RestClient#getRemoteResource(Class,Object,Serializer,Parser)} |
| </ul> |
| </ul> |
| </ul> |
| |
| <h5 class='topic w800'>juneau-rest-microservice</h5> |
| <ul class='spaced-list'> |
| <li> |
| The look-and-feel of an application is now controlled through the external configuration file and access to |
| CSS stylesheets in the working directory in a new folder called <code>files</code>: |
| <br><img class='bordered' style='width:170px' src='doc-files/ReleaseNotes.711.1.png'> |
| <br><br> |
| The default configuration is this: |
| <p class='bcode w800'> |
| <cc>#======================================================================================================================= |
| # REST settings |
| #=======================================================================================================================</cc> |
| <cs>[REST]</cs> |
| |
| <ck>staticFiles</ck> = <cv>htdocs:files/htdocs</cv> |
| |
| <cc># Stylesheet to use for HTML views.</cc> |
| <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv> |
| |
| <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv> |
| <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv> |
| <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv> |
| <ck>footerLink</ck> = <cv>http://www.apache.org</cv> |
| |
| <ck>icon</ck> = <cv>$C{REST/headerIcon}</cv> |
| <ck>header</ck> = <cv><a href='$U{$C{REST/headerLink}}'><img src='$U{$C{REST/headerIcon}}' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></a></cv> |
| <ck>footer</ck> = <cv><a href='$U{$C{REST/footerLink}}'><img style='float:right;padding-right:20px;height:32px' src='$U{$C{REST/footerIcon}}'></cv> |
| </p> |
| <br><br> |
| Note that static files can now be served up from the <code>files</code> directory in the working directory, |
| and you have access to modify the CSS theme files. |
| <br>The <code>SwaggerUI.css</code> file controls the look-and-feel of the Swagger UI, so you can make |
| modification there as well. |
| <br><br> |
| The <code>BasicRestConfig</code> interface (which defines the default settings for the <code>BasicRestServlet</code> class) |
| now looks like this... |
| <p class='bcode w800'> |
| <ja>@RestResource</ja>( |
| ... |
| htmldoc=<ja>@HtmlDoc</ja>( |
| header={ |
| <js>"<h1>$R{resourceTitle}</h1>"</js>, |
| <js>"<h2>$R{methodSummary,resourceDescription}</h2>"</js>, |
| <js>"$C{REST/header}"</js> |
| }, |
| navlinks={ |
| <js>"up: request:/.."</js> |
| }, |
| stylesheet=<js>"$C{REST/theme,servlet:/htdocs/themes/devops.css}"</js>, |
| head={ |
| <js>"<link rel='icon' href='$U{$C{REST/icon}}'/>"</js> |
| }, |
| footer=<js>"$C{REST/footer}"</js> |
| ), |
| |
| <jc>// These are static files that are served up by the servlet under the specified sub-paths. |
| // For example, "/servletPath/htdocs/javadoc.css" resolves to the file "[servlet-package]/htdocs/javadoc.css"</jc> |
| staticFiles={<js>"$C{REST/staticFiles}"</js>} |
| ) |
| <jk>public interface</jk> BasicRestConfig {} |
| </p> |
| <br><br> |
| The <code>PoweredByApache</code> widget which used to serve as a page footer has been eliminated. |
| <br><br> |
| If you're testing out changes in the theme stylesheets, you may want to set the following system property |
| that prevents caching of those files so that you don't need to restart the microservice each time a change is made: |
| <p class='bcode w800'> |
| <cc>#======================================================================================================================= |
| # System properties |
| #=======================================================================================================================</cc> |
| <cs>[SystemProperties]</cs> |
| |
| <cc># Disable classpath resource caching. |
| # Useful if you're attached using a debugger and you're modifying classpath resources while running.</cc> |
| <ck>RestContext.useClasspathResourceCaching.b</ck> = <cv>false</cv> |
| </p> |
| <li> |
| Upgraded to Jetty 9.4.12. |
| </ul> |