-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Labels
Description
Bug Report Checklist
Description
A structure accepting any valid JSON described at https://swagger.io/docs/specification/data-models/data-types/#any generates unusable Model code.
Example:
components:
schemas:
AnyValue:
description: Accepts any valid JSON value
anyOf:
- type: string
- type: number
- type: integer
- type: boolean
- type: array
items:
$ref: "#/components/schemas/AnyValue"
- type: object
additionalProperties: true
gets translated to
/**
* Accepts any valid JSON value
*/
@javax.annotation.Generated
class AnyValueDto(
) {
}
openapi-generator version
6.2.2
OpenAPI declaration file content or url
components:
schemas:
AnyValue:
description: Accepts any valid JSON value
anyOf:
- type: string
- type: number
- type: integer
- type: boolean
- type: array
items:
$ref: "#/components/schemas/AnyValue"
- type: object
additionalProperties: true
Generation Details
Steps to reproduce
Generate code using the described schema.
Related issues/PRs
Suggest a fix
A complex combination anyOf
should be translated to Any
(Java Object
) and should not try to generate custom empty Model class.
It should generate the same code as
components:
schemas:
AnyValue: { }