Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Enable adding of request interceptor to RedoclyAPIBlock
Related Issue
https://jira.corp.adobe.com/browse/DEVSITE-1190
Motivation and Context
Things I tried that didn't work:
https://redocly.com/docs/developer-portal/guides/reference-docs-hooks/#steps. The RedoclyAPIBlock setup doesn't work with this.
Also attempted to dynamically import the callback function, placing it in the static folder, similar to how we place open api spec in the static folder so we can access them within gatsby:
<RedoclyAPIBlock src="/redocly-test/openapi/openapi.yaml" requestInterceptorSrc="/redocly-test/_override/ReferenceDocsHooks.js" />
But that resulted in the following error being thrown:
Cannot find module '/redocly-test/_override/ReferenceDocsHooks.js'
It looks like this isn't supported in Gatsby yet:
So the only option left is to pass the function as a string. However, due to limitations in gatsby and markdown, the function string can't contain comments nor empty lines. This is mentioned in the readme.
How Has This Been Tested?
secret-key
Screenshots (if appropriate):
Types of changes
Checklist: