-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Refs not fixed up #51
Comments
🤢 |
That's one reason my current resolver outputs openapi: 3.0.0
info:
version: '1.0'
title: Demo API
paths:
/health/all.json:
get:
responses:
'200':
description: OK
content:
'*/*':
schema:
type: object
properties:
default:
title: Check
type: object
properties:
message:
type: string
description: bla
database:
title: Check
type: object
properties:
message:
type: string
description: bla However, I don't think I can currently recommend using the resolver in cc @philsturgeon : I agree with @RomanGotsiy, this is unlikely to be trivial. Workaround (everything can be solved by another level of indirection): swagger: 2.0
info:
version: '1.0'
title: Demo API
paths:
/health/all.json:
get:
responses:
200:
description: OK
schema:
$ref: '#/definitions/health'
definitions:
health:
$ref: definitions/health.yml#/Result Ie. extract schemas to I see two possible approaches:
Problems (respectively):
@RomanGotsiy does any other approach leap out at you? |
@MikeRalphson thanks for looking into this. Nevertheless, this issue is not limited to resolver output. I think someone can write similar spec by hand (it's completely valid according to the spec I believe). So we have to fix it anyway. The approach 1 looks simpler to me TBH. Let me stew on it a bit and I will try to send a PR on weekends. |
Absolutely. I'm looking at approach 2 at the moment (its only around a dozen lines of code so far). I can always revert it if you come up with a better fix. When do you next plan to cut a release of ReDoc, so we can coordinate? |
I am going cut the next alpha today without this issue fixed. I will cut one more once this issue is fixed. I'm flexible with alpha releases 😄 |
@philsturgeon is it possible to share (privately?) your full OAS v2 document so I have another testcase? |
Done! Suggested the workaround for now. |
@MikeRalphson well done 👍 😮! |
Fixed using a |
Not all the refs are fixed up after conversion. The internal ones (not to
#/definitions
) are not.I checked your code and I'm not sure whether we can fix it efficiently but maybe you know how to do it.
Checklist
Detailed Description
Input:
Output with broken ref:
The text was updated successfully, but these errors were encountered: