Releases: openapi-processor/openapi-processor-spring
2023.6
this release brings improved enum support.
It can be used to fix conversion issues (see #198) when enums are used as parameters (i.e not as part of the request body).
See the core release notes 2023.6 for the basic details.
openapi-processor-mapping: v5
options:
package-name: generated
enum-type: framework
openapi-processor-spring supports the framework
enum-type
.
It generates a Java enum class similar to the default
enum type. In addition it generates a Spring ConverterFactory
that Spring can use to convert incoming enum values to its corresponding java enum value (if passed as a parameter, not as part of the body).
To enable the ConverterFactory
, create a configuration class like this:
package io.openapiprocessor.samples;
import {package-name}.spring.StringToEnumConverterFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@SuppressWarnings("rawtypes")
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverterFactory(new StringToEnumConverterFactory());
}
}
This registration is one time task. The converter factory does create an enum converter for all generated enum classes.
There is a sample is using different enum-type
configurations (string
& framework
).
dependency updates
- updated openapi-processor-core to 2023.6
2023.5
2023.4
this release brings a few improvements
- json schema validation for OpenAPI 3.1
- mappings with generic wildcard
See the core release notes 2023.4 for a detailed description of the changes.
#192 missing import
Spring doesn't have shortcut annotations, e.g. @GetMapping
instead of @RequestMapping(..., method = RequestMethod.HEAD)
for the http methods HEAD, OPTIONS & TRACE.
The processor does now add the missing import of RequestMethod
.
dependency updates
- updated openapi-processor-core to 2023.4 (was 2023.3)
2023.3
this release includes two new features
- add an annotation with a single mapping to all generated model classes
- generate java
record
s instead of pojo classes.
See the core release notes 2023.3 for a detailed description of the changes.
dependency updates
- updated openapi-processor-core to 2023.3 (was 2023.2.2)
2023.2.2
2023.2.1
2023.2
this release includes few of mapping improvements: it is now possible to create a mapping with nested generic types and annotation mapping allows class types (e.g. package.Foo.class
) as parameter.
See the core release notes 2023.2 for a detailed description of the changes.
dependency updates
- updated openapi-processor-core to 2023.2 (was 2023.1.2)
2023.1.2
2023.1.1
2023.1
this release includes a couple of mapping improvements for bean validations & annotation mapping. Both will work on mapped types. It also brings bean validation v3 support for Spring Boot 3.
See the core release notes 2023.1 for a detailed description of the changes.
dependency updates
- updated openapi-processor-core to 2023.1 (was 2022.6)