October 2024
-
openapi-processor-spring/micronaut 2024.5
support for servers/server/url
it is now possible to tell the processor to generate a properties resource file with the path of a selected OpenAPI servers/server/url
.
Given an OpenAPI description with a servers
key:
openapi: 3.1.0
info:
title: server url example
version: 1.0.0
servers:
- url: "https://openapiprocessor.io/{path}"
variables:
path:
default: api
# ...
and a mapping
openapi-processor-mapping: v9
options:
base-path:
# false/true=0,1,2,... (default false)
server-url: true
it will generate a properties file api.properties
openapi.base.path = /api
that can be used to configure the (Spring) context-path
:
# application.properties
#spring.config.import = api.properties
server.servlet.context-path=${openapi.base.path}
See Server Url for more.
javadoc of record
a record should have its javadoc at the record using @param
s to describe the record properties.
Instead of
/**
* this is the <em>Foo</em> schema description
*/
@Generated(value = "openapi-processor-core", version = "test")
public record Foo(
/**
* <em>property</em> description
*/
@JsonProperty("foo-bar")
String fooBar
) {}
the processor now generates:
/**
* this is the <em>Foo</em> schema description
*
* @param fooBar <em>property</em> description
*/
@Generated(value = "openapi-processor-core", version = "test")
public record Foo(
@JsonProperty("foo-bar")
String fooBar
) {}
warn on endpoint without success response
the processor ignores endpoints that have no success response (i.e. 2xx response code). To detect this "error" at compile time the processor will now print a warning with the effected endpoint.