-
Notifications
You must be signed in to change notification settings - Fork 9.1k
referencing objects does not work with the model #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ralphvanetten - by definition you need to use full refs. So |
Yes, and you need to wrap your $ref in a schema... like so "externalId1" : {
"title" : "first",
"type" : "object",
"schema": { // < -------------- This will make it work like you expect
"$ref" : "#/definitions/map1"
} // ------------------- :)
},
... Then it'll work as expected (I tested :) ) |
Ah, yes, ofcourse... I knew it had to be some silly mistake.. |
@ralphvanetten ...and by tested I mean with the latest source, so it'll be in a release soon :( |
@ponelat oh, I guess was a bit optimistic with closing then :) Anyway, I guess it is fixed in swagger-js? Can you tell which commit and is it documented somewhere how to use your own swagger-js instead of the default one used by swagger-ui? Thanks. |
@ralphvanetten Funny you should ask! We wrote up this a few day(s) ago.... |
I made another guide, might be easier to maintain than the DIY version. |
When I use the develop_2.0 branch of both swagger-ui and swagger-js it is indeed fixed. Thanks! |
So we can close the issue ;) |
Actually. The correct solution is to use:
As soon as you add anything else like |
When I add a reference to another object it does not show up in the model. But the weird thing is that when I wrap the reference in an array it works:
however it does show up in the model schema:
Is this a bug or is there something wrong with my swagger file. I tried master and develop_2.0, they both gave the same result.
A stripped down version of the swagger file is shown below:
The text was updated successfully, but these errors were encountered: