Skip to content

2023.2

Compare
Choose a tag to compare
@hauner hauner released this 01 Jun 06:58
· 13 commits to 2023.2.x since this release

openapi-processor/openapi-processor-spring#150 (new), type mapping with nested generics

so far openapi-processor did allow only one level of generics. It is now possible to create type mappings with nested generics types.

openapi-processor-mapping: v2

options:
  package-name: generated

map:
  types:
    - type: Foo => java.util.Map<java.lang.String, java.util.List<java.lang.String>>

  paths:
    /foo:
      responses:
        - content: application/json => java.util.Map<java.lang.String, java.lang.String>

    /foo2:
      responses:
        - content: application/json => java.util.Map<java.lang.String, java.util.List<java.lang.String>>

This is useful to map an OpenAPI dictionary description using additionalProperties to a proper java map type:

# a schema the defines a dictionary with string keys and string values 
Map:  
    type: object
    additionalProperties:
      type: string

openapi-processor/openapi-processor-spring#161 (new), annotation mapping allows class parameter

annotation mapping now accepts a java class type as parameter. It is now possible to add a mapping like this:

openapi-processor-mapping: v3

map:
  types:
    - type: string:foo @ io.oap.Annotation (value = io.oap.Bar.class)

openapi-processor/openapi-processor-spring#160 (fix), lost javadoc comment with type mapping

having a type mapping on the type of an object property did not write its description as javadoc comment as it does without mapping.

improved validation output

schema validation by the internal parser has simpler & better output based on the JSON schema basic output format. It is not perfect but it is getting better.

It will provide better help on where the error is, but it may report multiple ambiguous errors.

If a schema property uses anyOf or oneOf and all possibilities don't match (e.g. because there is a spelling error) the validator can't know which one was meant and complains about all of them.

An example:

the error the value does not validate against the 'false' schema at instance ... usually means that a property has a spelling error.

If the OpenAPI allows a $ref at the same location the validator reports a second error should have a property '$ref' at instance ... because a reference object must have a $ref property.

dependency updates

  • updated internal openapi-parser to 2023.2 (was 2023.1)
  • updated swagger parser to 2.1.14 (was 2.0.28)
  • update jackson to 2.15.1 (was 2.14.1)