swagger-ui: Wrong model titles when composing using allOf

When composing models using allOf, swagger-ui displays wrong model title for composed model. It uses last model referenced in allOf instead of one defined.

Definition:

definitions:
  Simple1:
    type: object
    properties:
      id1:
        type: integer
        format: int64
  Simple2:
    type: object
    properties:
      id2:
        type: integer
        format: int64
  Composed:
    allOf:
      - $ref: '#/definitions/Simple1'
      - $ref: '#/definitions/Simple2'

Expected result:

Simple1{...}
Simple2{...}
Composed{...}

Actual result:

Simple1{...}
Simple2{...}
Simple2{...}

Affected version: v3.0.0-229-g7790383

Ghist with full issue demonstration

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 11
  • Comments: 21 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I have encountered the same problem, how is the progress?