A very substantial new release of Agrest....
1. "Code-first" OpenAPI/Swagger integration
While we've made earlier attempts to work with OpenAPI, they were all half-baked and barely usable. Now finally something that "just works". E.g. the following code would be automatically compiled to a working OpenAPI descriptor with all the Agrest parameters (a full example using Bootique can be found here [1]) :
@GET
public DataResponse<Entity> get(@Context UriInfo uriInfo) {
...
}
And you can enrich the model further via Swagger annotations. I went as far as deprecating the existing Agrest metadata API, as it makes no sense to compete with OpenAPI and maintain our own format.
2. New "exp" protocol parameter
The release also features a rare REST protocol change: "cayenneExp" parameter was renamed to just "exp", to remove any confusion as to why Cayenne is mentioned there. The change is 100% backwards-compatible and "cayenneExp" will still continue to work indefinitely. But if you have control over the client code, I'd recommend start using the new parameter name.
There's lots of other cleanup and streamlining of the code, support for the new Cayenne 4.2 Json type, etc. Full release notes:
• #459 "code-first" OpenAPI support and Swagger integration
• #460 Support for the new Cayenne "Json" type
• #462 "exp" key to replace "cayenneExp"
• #465 AgIdPart metadata object
• #466 Deprecate Agrest metadata API
• #467 Injectable AgDataMap, remove redundant IMetadataService
Enjoy!
Andrus
[1]
https://github.com/bootique-examples/bootique-agrest-swagger-example