fern-api / fern

Input OpenAPI. Output SDKs and Docs.
https://buildwithfern.com
Apache License 2.0
2.69k stars 151 forks source link

[Feature] Add ability for EndpointRequestSnippet to output a snippet in other languages #5206

Open cassiedoll opened 3 days ago

cassiedoll commented 3 days ago

Problem description

Right now the EndpointRequestSnippet outputs curl snippets. It would be great if it had the ability to output typescript or python, similar to the API reference snippets.

Why would it be useful?

When writing getting started guides it is sometimes helpful to have multi-language examples.

Describe the solution (optional)

Consider adding either a language param, or perhaps allow the endpoint to output tabbed snippets, in the same format as the API reference.

<EndpointRequestSnippet endpoint='POST /plants' language='python'/>

or

<EndpointRequestSnippet endpoint='POST /plants' tabbed='true'/>