OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
-attribute paths.'.....requestBody.content.'application/json'.schema.properties is not of type `object`
It feels like validation ignores #/properties. bundling with -dereference however recognizes the reference correctly and works fine but applying generator on a bundled & dereferenced spec is a so-so workaround because it loses the filename context and generated DTOs have very clunky naming.
I also tried to walk around this by having:
MySchemaProps.yaml
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `io.swagger.v3.oas.models.media.ObjectSchema` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('./MySchemaProps.yaml')
at [Source: UNKNOWN; byte offset: #UNKNOWN]
Again, bundling with -dereference works fine on this too but not generator.
Bug Report Checklist
Description
I've been following the idea from https://github.com/OAI/OpenAPI-Specification/issues/1590#issuecomment-786447707 to "override"
required
field.MySchema.yaml
src/spec.yaml
The generator fails on:
It feels like validation ignores
#/properties
. bundling with-dereference
however recognizes the reference correctly and works fine but applying generator on a bundled & dereferenced spec is a so-so workaround because it loses the filename context and generated DTOs have very clunky naming.I also tried to walk around this by having: MySchemaProps.yaml
MySchema.yaml
to avoid
#/
ref, but I getAgain, bundling with
-dereference
works fine on this too but not generator.Neither works an example from spec: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#models-with-composition all
allOf
props in Kotlin generator goes to some weirdallOf
-prefixeddata class
and there is no DTO with all of the properties in one place.openapi-generator version
6.2.1
Related issues/PRs