Give x-fern-examples
separate fields for sample-name
and language
#5550
Labels
feature
Requests for new features.
product/docs
Fern Docs which builds and hosts a developer documentation site
Feature Description
We add sample code for each API operation's
x-fern-examples > code-samples
field inopenapi.yaml
. This is successfully shown to the user in a sample code box.We include 3 types of sample code in that box for each API operation, showing 3 ways of accessing that API operation:
language
field tocurl
language
field toPython API
language
field toPython SDK
This approach mostly works: we see all 3 values in the dropdown, and sample code for each shows correctly.
The one problem we have with this approach stems from the fact that for each code sample, the
x-fern-examples > code-samples > language
field sets both the dropdown option name and the language. The former is needed to populate the dropdown picker, and the latter is needed to figure how to do syntax highlighting for the sample code.This means that if we set the
language
field toPython API
orPython SDK
, it can’t tell what language the sample code is in, so it disables syntax highlighting.To preserve syntax highlighting, we’d like a way to specify the dropdown option name separately from the language of the sample code.
For example, maybe have these 2 fields for each piece of sample code in
openapi.yaml
:x-fern-examples > code-samples > sample-name
which might be set to “Python SDK"x-fern-examples > code-samples > language
which might be set to “python”In
openapi.yaml
the proposed scheme might look like this:Use Case
see above
Proposed Experience (Optional)
see above
Alternatives Considered (Optional)
No response
The text was updated successfully, but these errors were encountered: