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.
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'
Simple1{...}
Simple2{...}
Composed{...}
Simple1{...}
Simple2{...}
Simple2{...}
Affected version: v3.0.0-229-g7790383
Same issue is affecting latest master: v3.0.0-235-g6cd66bb
It seems that underlying problem is that schema of model composed with allOf has $$ref key of last items in allOf array.
This seems like swagger-js issue.
Just added a test on SwaggerJS, it passes: https://github.com/buunguyen/swagger-js/commit/5421ff87f6d26fe593781a04e2677232daefdf1f. Seems to work fine on JS side.
I have encountered the same problem, how is the progress?
We're not working on a fix right now. Would be happy to review PRs.
This appears to be fixed:

Closing - please ping if there are any further problems with this!
@shockey This problem is still occurring for me in Swagger UI. I just pulled the latest 3.1.2 and it is still showing the base model name and description as I described in #3417 using https://github.com/swagger-api/swagger-ui/files/1160284/duplicate-models.yaml.txt I verified that my browser is not showing cached swagger-ui content.
@DavidBiesack, your problem is valid but slightly different. This issue centers around inheriting the name based on the key name of the model, and yours has to do with the title property.
We'd be happy to look into it - can you open a new issue since this one is fixed?
@shockey Please reopen #3417 which covers it all already - it was closed as a dup of this but apparently it is not really a dup. Thanks!
@DavidBiesack sure, reopening now.
This is still happening to me both in the web version and in the docker image (swaggerapi/swagger-editor:latest). Does it still have to be merged somehow?

Confirmed.
this caused the regression... https://github.com/swagger-api/swagger-ui/pull/3514 . So we need to ensure we don't regress on https://github.com/swagger-api/swagger-ui/issues/3505 as we fix _this_ regression :grin:
Also seeing this is my internal fork (updated to b6cd504 currently). I'm looking to resolve the issue this week hopefully - will try to submit a PR here as well.
Update: My team (not associated with SmartBear / Swagger team) decided not to pursue this issue currently. I did some preliminary research, and the issue seems to be very much what @lekoder suggests. In swagger-js, a model composed using allOf will pull all props, including references. This means that as the tree is resolved, references get walked all the way back up to the root reference.
In our case, we are working with an OData based API, and all of our entities inherit from a base OData.Entity type. This bug causes our entire model to display only OData.Entity for types, as all the $refs were resolved up the tree.
We ended up reverting #3514 on our internal build for now.
What about? I'm trying editor.swagger.io, but still the same problem.

Hi,
Me too... any estimation when is it going to be solved?
A small fix: change properties to - properties, so only the model name
is wrong. The content is good.
2017-09-04 15:22 GMT+02:00 tvappagency notifications@github.com:
Hi,
Me too... any estimation when is it going to be solved?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/swagger-api/swagger-ui/issues/2946#issuecomment-326962312,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK3QZgehEsMT54nxt9H24ZgfsGawe24xks5se_mZgaJpZM4ND4MA
.
Fixed by https://github.com/swagger-api/swagger-js/pull/1130, which should be released this week 🎉

Tip : add composition value with the model title :
- $ref: '#/definitions/Simple1'
- $ref: '#/definitions/Simple2'
=>
- $ref: '#/definitions/Simple1'
- $ref: '#/definitions/Simple2'
- title: "Composed"
Most helpful comment
I have encountered the same problem, how is the progress?