feat: add option to disable external reference resolution#1118
feat: add option to disable external reference resolution#1118AnshumohanAcharya wants to merge 1 commit intoasyncapi:masterfrom
Conversation
- Add resolveExternal option to ResolverOptions - Allow disabling external (http/https/file) reference resolution - Internal JSON pointer references still work when disabled - Defaults to true for backward compatibility Fixes: asyncapi#1098
|
There was a problem hiding this comment.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|
|
This pull request 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 pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request 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 pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |



Description
This PR introduces a new
resolveExternaloption to theResolverOptionsinterface that allows users to disable external reference resolution ($refpointing to http, https, or file URIs) while preserving internal JSON pointer reference resolution.Key Changes:
resolveExternal?: booleanproperty toResolverOptionsinterfacecreateResolver()function to conditionally include default resolvers (http, https, file) based on theresolveExternaloptionresolveExternalis set tofalse, external reference resolution is disabled#/components/messages/message) continue to work regardless of this settingresolveExternaldefaults totrue) for backward compatibilityUsage Examples:
Testing:
Added comprehensive test suite (
external-ref-disabled.spec.ts) that verifies:All existing tests pass (2470 tests), ensuring backward compatibility.
Related issue(s)
Fixes #1098