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

Reusable components across repo's in a service oriented architecture #3605

Closed
aravindhbw opened this issue Feb 23, 2024 · 3 comments
Closed
Labels
question re-use: ref/id resolution how $ref, operationId, or anything else is resolved

Comments

@aravindhbw
Copy link

In OpenAPI 3.0, I understand there is a way to create reusable components across files in the same repo and reference them using $ref. Curious if there is a way to host global components in a private repo which can be referenced across services in their own repos in a microservice world. Mainly for consistency and preventing redundancy.
Any pointers would be really helpful.

@SSYH
Copy link

SSYH commented Feb 23, 2024 via email

@handrews
Copy link
Member

@aravindhbw in theory, $ref can point to any resource with a URL. In practice, support for this can be inconsistent across tooling, so you should look into what your tools support. We are working on improving this in future releases, and on adding more info on this to learn.openapis.org.

@handrews handrews added question re-use: ref/id resolution how $ref, operationId, or anything else is resolved labels Feb 24, 2024
@handrews
Copy link
Member

I don't think there is a spec change to consider here, and it looks like my answer was acceptable enough, so I'm going to go ahead and close it. We are clarifying how referencing works in 3.0.4 and 3.1.1 which will be out in the next few months (ideally no later than July, but don't quote me on that). So if you want more guidance you can look at those works-in-progress.

Otherwise, if your tools don't support this, the answer is to lobby them to add support once 3.0.4 and 3.1.1 come out.

Please feel free to open a new issue if there is something specific you would like to see changed, or if I missed something here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question re-use: ref/id resolution how $ref, operationId, or anything else is resolved
Projects
None yet
Development

No branches or pull requests

3 participants