Skip to content

[BUG] Resolving responses when using $ref is broken since v.7.14 #21588

@comrt

Description

@comrt
Description

When referencing responses with inline type in operations, the generator used to generate a model with distinct name. With version 7.14 a model with the the generic name InlineObject gets generated.

openapi-generator version

v.7.14.x

OpenAPI declaration file content or url
paths:
  /referenced-response-with-inline-schema:
    get:
      operationId: getReferencedResponseWithInlineSchema
      tags:
        - Responses
      responses:
        '200':
          $ref: '#/components/responses/ReferencedResponseWithInlineSchema'
components:
  responses:
    ReferencedResponseWithInlineSchema:
      description: ReferencedResponseWithInlineSchema
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
Generation Details
Steps to reproduce
Related issues/PRs

swagger-api/swagger-parser#2127

Suggest a fix

Swagger-parser 2.1.23 introduced a new ParseOptions-API.
swagger-api/swagger-parser#2127

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions