OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.48k stars 6.5k forks source link

[BUG] allOf doesn't create a new class but a method #18782

Open icarusfire opened 4 months ago

icarusfire commented 4 months ago

Issue happens after migrating from version 5.0.0 to 7.X open api generator version 7.0.1 (also tested in 7.6)

This yaml results in a model class called "UpdateContractID". There should be no class called like this, but only a new model class called "UpdateContractRequest" as defined in allOf.

patch:
      consumes:
        - application/json-patch+json
      operationId: UpdateContractID
      tags:
        - Deprecated
      parameters:
        - $ref: '#/parameters/LastUpdateUser'
        - name: patchDocument
          in: body
          required: true
          schema:
            allOf:
              - type: object
                properties:
                  patchDocument:
                    type: array
                    items:
                      $ref: '#/definitions/updateContractRequest'

Things I tried and did not help: --inline-schema-options REFACTOR_ALLOF_INLINE_SCHEMAS=true --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true, REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true

@wing328 Would be great if you can assist. thanks

icarusfire commented 4 months ago

@jimschubert @jmini @etherealjoy @wing328 Any chance you could help with this? Much appreciated