Release 9.0.0
Date: Feb 27, 2023
Juneau 9.0.0 is a major release. Deprecated APIs that have been accumulating over time have been removed.
Major changes include:
- The code has undergone significant refactoring to ease maintainability and improve overall performance.
- Configuration properties have been removed entirely. They have been replaced with a standard builder-based architecture. In addition to making the code more maintainable, it also improves performance when creating new serializers/parsers/rest clients (and others).
- REST servlets now seamlessly integrate with Spring Boot.
juneau-marshall
-
Eliminated the various
@XConfig(applyX={...})
annotations and replaced them with the ability to apply targeted annotations directly to configuration classes and methods (such as REST classes/methods).@Rest(...)
@Bean(on="MyBean1,MyBean2",sort=true)
@UrlEncoding(onClass=MyList.class,expandedParams=true)
public class MyRestClass {
@RestOp(...)
@Bean(on="MyBean1,MyBean2",sort=false)
@UrlEncoding(onClass=MyList.class,expandedParams=false)
public Object myRestMethod() { ... }
} -
JSON 5 support.
-
New @Marshalled annotation for non-bean classes.
-
New @BeanConfig(ignoreUnknownEnumValues) annotation and support for ignoring unknown enum values during parsing.
-
Java Serialized Object marshalling support has been removed entirely due to security risks with usage (better safe than sorry).
juneau-rest-common
New module containing the common REST classes/annotations uses by both the client and server APIs. These were previously contained within juneau-marshall.
-
Significant refactoring of the classes in the org.apache.juneau.http package and subpackages. Attempts were made to make classes as natural extensions to the Apache HttpComponents APIs. Significant new functionality here.
-
@RemoteMethod
annotation has been replaced with the following:RemoteOp RemoteGet RemotePut RemotePatch RemotePost RemoteDelete
juneau-rest-server
-
Significant refactoring done to allow for many extensible aspects of the API to be performed through injected beans in Spring. These include logging, debugging, REST method arg types, static files, file finders, swagger creators, thrown stores, response processors, serializers/parsers, JSON schema generators, statistics gathering stores, and default request attributes/headers and response headers.
-
@RestMethod
annotation has been replaced with the following:RestOp RestGet RestPut RestPatch RestPost RestDelete -
Defining REST resources with predefined marshalling support is now much simpler. You can now extend from a basic REST servlet/object.
// A root resource that supports JSON/HTML marshalling.
public class MyRootResources extends BasicRestServletGroup { ... }
// A child resource that supports all available marshalling.
public class MyChildResource extends BasicRestObject { ... }Available basic REST classes:
BasicRestServlet BasicRestServletGroup BasicRestObject BasicRestObjectGroup
juneau-dto
Addition of OpenAPI 3.0 (openapi3 package).
juneau-rest-server-springboot
The requirement for using JuneauRestInitializer
during App initialization to use bean injection has been eliminated.
Instead, root resources should simply extend from BasicSpringRestServlet and BasicSpringRestServletGroup.
These will automatically hook into the Spring Boot framework for resolution of REST children and various extension beans added to the REST API framework.
juneau-rest-client
While the general usage pattern stays the same, the REST client code has undergone significant rewriting. It is now more inline as an extension of the Apache HttpClient library. Much new functionality such as support for fluent assertions has been added.
// Create a basic REST client with JSON support and download a bean.
MyBean bean = RestClient.create()
.json5()
.build()
.get(URI)
.run()
.assertStatus().asCode().is(200)
.assertHeader("Content-Type").matchesSimple("application/json*")
.getContent().as(MyBean.class);
juneau-rest-mock
Entirely rewritten. Changes too many to list.