One of Swagger’s strongest selling points is the ability to generate client code from an…
If you’re using the springfox-swagger2 library, you might come across a problem when it comes to generic types (such as Pet<T>). In cases where diamond brackets are used, Swagger will generate an invalid specification, resulting in a validation error in the Swagger Editor (“”$ref values must be RFC3986-compliant percent-encoded URIs”).
The Java Stream API is a wonderful tool, but not without its shortcomings. There is a bug in Java 8 & 9 which affects the number of threads used by a parallel stream in a seemingly unpredictable way. Beware!
By default, Spring Boot uses an OpenEntityManagerInViewInterceptor which “binds a JPA EntityManager to the thread for the entire processing of the request […] to allow for lazy loading in web views despite the original transactions already being completed”.
In other words, in every
@RestController action, instead of throwing a
LazyInitializationException when you forget to fetch a lazy-loaded property, Spring will now fetch the property outside of the original transaction. The pattern (or antipattern) is called Open Session In View (OSIV) and, while it sounds fairly useful, is not a good choice for production environments.
Spring Boot, by default, uses Thymeleaf 2 as its template engine. You can, however, make it use the newer version.