1

The redoc guide specifies using raw text as source in a code sample: https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md#x-codeSamples like so:

lang: JavaScript
source: console.log('Hello World');

however I would like to keep my OpenApi3.0 YAML a living document, so would prefer to actually import code directly from test files, ex:

lang: JavaScript
source: #/tests/js_api_test.js

where the contents of js_api_test.js is just:

console.log('Hello World');

this way the imported code could be guaranteed to work as long as the tests are passing - keeping the document living.

Given I am already relying on generating lots of boilerplate off of the YAML file it seems ideal to keep all aspects of the file living.

Thanks in advance!

nbenz
  • 41
  • 5

1 Answers1

1

found answer:

                label: 'Python'
                source: {$ref: test.py}

will import the relative path file test.py there

nbenz
  • 41
  • 5