Skip to content

Scheme inlining works incorrect in SerializeAsV2 #1151

@Ztare

Description

@Ztare

Describe the bug
When serialize OpenApi structure with multiple response schemes with different http codes and same models with InlineLocalReferences = true

To Reproduce

it inlines only first model, other models are replaced with refs

  /sample:
    post:
      responses:
        '200':
          description: Success
          schema:
            type: array
            items:
              $ref: '#/definitions/PostRespDto'
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/PostRespDto'

with inlining will be

  /sample:
    post:
      responses:
        '200':
          description: Success
          schema:
            type: array
            items:
              type: object
              properties:
                SampleProperty:
                  type: string
              additionalProperties: false
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/PostRespDto'

Expected behavior

paths:
  /sample:
    post:
      responses:
        '200':
          description: Success
          schema:
            type: array
            items:
              type: object
              properties:
                SampleProperty:
                  type: string
              additionalProperties: false
        '202':
          description: Accepted
          schema:
            type: object
            properties:
              SampleProperty:
                type: string
            additionalProperties: false

Screenshots/Code Snippets
Merge request will be linked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions