Skip to content

feat: add support of custom communication protocols #146

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

Conversation

raman-kananovich
Copy link

the new optional parameter loader is added to referenceResolver function. It
can be used to override the mechanism of loading JSON schemas. For an example it
is suitable for overriding original URIs to load corresponding schemas from
another resources or loading JSON schemas via protocols different from
http/https/fileSystem e.g. pub/sub one.

contains part of implementation of the issue #587

the new optional parameter `loader` is added to referenceResolver function. It
can be used to override the mechanism of loading JSON schemas. For an example it
is suitable for overriding original URIs to load corresponding schemas from
another resources or loading JSON schemas via protocols different from
http/https/fileSystem e.g. pub/sub one.

contains part of implementation of the issue #587
@raman-kananovich
Copy link
Author

@BelfordZ, could you please take a look at this PR?

@BelfordZ
Copy link
Member

BelfordZ commented May 6, 2021

@raman-kananovich Thank you so much for the PR. I really like a lot of the design decisions you made. I hope you don't mind that I've created another PR to implement similar thing in a slightly different way.

If it helps, I could consider cutting a branch-release for this if you have code that is depending on it. Might help you transition over. Otherwise, let me know what you think and if there are some improvements that you require.

@raman-kananovich
Copy link
Author

@BelfordZ, thank you for your PR! The new approach you introduced covers all required functionality on our side. And I really like it!

Can I ask you to extend the API of schema-utils-js to give access to the new feature from the upper layer?

For an example:
parseOpenRpcDocument.referenceResolver.protocolHandlerMap['protocol'] = () => {};

@BelfordZ
Copy link
Member

on it!

@BelfordZ BelfordZ closed this May 10, 2021
@BelfordZ
Copy link
Member

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

Successfully merging this pull request may close these issues.

2 participants