Skip to content

Conversation

@m-murasovs
Copy link
Contributor

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

And in the old/current docs like this: (I had to fix the background color)
CleanShot 2024-12-04 at 16 27 02@2x

@netmilk netmilk requested review from B4nan and janbuchar December 4, 2024 15:42
@m-murasovs
Copy link
Contributor Author

Update:

  1. The samples are now using the one-liner pattern, as approved by Mara himself
  2. The x-codeSamples param is now added automatically during build, if there is a code sample exists for the operation

Copy link
Contributor

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works, it is perfect 🙂

@janbuchar janbuchar merged commit ea2fee3 into apify:master Dec 10, 2024
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants