Skip to content
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

Non-local $refs #170

Open
rhysdoliver opened this issue Sep 6, 2023 · 1 comment
Open

Non-local $refs #170

rhysdoliver opened this issue Sep 6, 2023 · 1 comment

Comments

@rhysdoliver
Copy link

Problem

I'm currently working on a project where I have an openAPI spec which is organised as a folder. I've been experimenting with using this library to generate schemas only, which has been working great for my use case! But I have found the $ref is hardcoded to assume the spec is only using local references, meaning i currently have to manually update each file.

Proposal

I thought it might be good to have a argument on generateComponents that controls the reference type (local/remote/server), as per the swagger guidance Using $ref. Scope may be wider to make it compatible with the whole library? Happy to make a PR myself

@AGalabov
Copy link
Collaborator

AGalabov commented Sep 9, 2023

@rhysdoliver thank you for the suggestion. I do think this makes sense. I think we've thought about providing a "base path" of where documents are being stored. I.e not necessarily under /components or /schemas.

And yes such a task should ideally be done for the whole library - meaning both v3 and v3.1 and also for generateComponents and generateDocument. One thing that comes to mind is that this can be done with an optional second parameter to the Generator constructor and it would influence both behaviors.

Feel free to open up a PR for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants