You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add code examples that use both our JavaScript API client and the TypeScript clients using the x-codeSamples approach.
The issue
Since there's no TS support for now (is there a plan to add this btw?), I wanted to add multiple examples, just like there are for each language by default (e.g. JavaScript has Fetch, jQuery, and XHR), but I haven't been able to find a way that works.
The question
Is it possible to add multiple code snippets using x-codeSamples?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Here are the first two code samples for the API docs. These are for the
JS client and are a tentative proposal. When we've agreed on how they
should look, I'll also add the ones for the Python client.
**Note**: The Palo Alto plugin currently doesn't support TypeScript and
there's no straightforward way to add multiple custom code samples for
the same language (I thought we could have JS and TS client samples
under the JavaScript bit).
I have created an issue asking about this on the plugin's repo:
PaloAltoNetworks/docusaurus-openapi-docs#1035
**Note 2**: For the POST request, as mentioned by @netmilk , it would be
nice to have the request body present, but that would be complicated,
since the schema isn't available in the examples, and would make the
testing harder. I think it's not so bad, though, since the request body
is shown right under the code example, so it's quite easy to find.
So, on the new docs it will look like this:
![CleanShot 2024-12-04 at 16 06
42@2x](https://github.com/user-attachments/assets/d4c00c7b-d5e3-476c-bb3c-61fa9e1ea0e3)
And in the old/current docs like this: (I had to fix the background
color)
![CleanShot 2024-12-04 at 16 27
02@2x](https://github.com/user-attachments/assets/25279a78-8738-433d-bf31-54aee9205d69)
What I'm trying to achieve:
I want to add code examples that use both our JavaScript API client and the TypeScript clients using the
x-codeSamples
approach.The issue
Since there's no TS support for now (is there a plan to add this btw?), I wanted to add multiple examples, just like there are for each language by default (e.g. JavaScript has Fetch, jQuery, and XHR), but I haven't been able to find a way that works.
The question
Is it possible to add multiple code snippets using
x-codeSamples
?Thanks in advance!
The text was updated successfully, but these errors were encountered: