-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add a way to fully customize how schemas are fetched #731
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
@EricWittmann hey, definitely makes sense. Would you be interested in contributing it? |
I would be interested. If you have some ideas about direction, that would help. Having recently implemented support for authentication when using the AsyncAPI react component, I discovered that auth information needed to be provided twice - once in the If I could just provide my own resolver, that same resolver should be used for all external references, not just the main one. I didn't dig deeply enough to determine how feasible that is. It will depend on how much of the parser's external |
This has actually risen a bit in our priority list because alternate approaches to solve our problem are ... problematic. :) I implemented a feature in registry where we rewrite the values of the We could implement a proxy, or find some other approach. But ultimately we think the right approach is for the client to understand how to resolve and fetch the schemas using a custom resolver that we provide. So yeah - I'd love to contribute that. If you have any pointers for getting started with it, great. If not I'll dig in as soon as I can. |
@EricWittmann if I understand your request correctly, the solution is easier, but not really 😄 long story short: this component uses our JavaScript Parser to validate, dereference and parse AsyncAPI documents. So any customisations for why am I writing the whole story? as to address your idea, any customizations should be done without workarounds, by using the customer resolvers functionality that the open questions are:
related issues:
this is super complicated topic as you can see because we are in the middle of AsyncAPI 3.0 preps + new parser intro and some other stuff and regarding migration of parser v1 to v2 in react, there is a pretty good migration guide that will help |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Had an issue where I require to use my own fetch implementation as resolver of https schemas. |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Description
Allow an optional function to be provided when using this component that will be called to fetch a schema when e.g. a reference needs to be resolved.
Reasons
In our project (Apicurio Registry) it would really helpful to be able to customize how the schema (and any references) is fetched. Currently the FetchingSchema interface is good if I just want to provide e.g. auth information (great) but not if I need to actually change how a schema is fetched. In our case the value of the
$ref
can be a "logical" value that is then mapped to coordinates in the registry (mapping is configured externally to the AsyncAPI document).Additionally, we would load the content by making a REST call using our SDK/client - so being able to provide our own function to resolve and then load the ref content would be ideal.
Is there already a way to do this? If not, perhaps I could contribute...
The text was updated successfully, but these errors were encountered: