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'
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.
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: