New fields for client code snippets #5388
baywet
started this conversation in
Enhancements
Replies: 2 comments 1 reply
-
|
Just off the top of my head:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
We could formalise |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
One of the main scenarios to use OpenAPI is to generate documentation for humans to read.
The specification does a great job at describing all the aspects to craft the HTTP request, and deal with the HTTP response. It also provides "places" to provide examples for both (example, and examples fields). Those are great when using "barebone" HTTP clients on the platform, and crafting payloads manually.
However, more often than not, the API producer may also provide SDKs, or want to provide end to end code snippets for a given operation with the native client for the platform.
I propose that we create such a place so people don't have to rely on extensions for such things! (could be in a SAF as well, depending on where the SAF discussion goes). Here is a quick example
Here a couple of things are interesting:
The snippets entry is at the media type level, this is to account for operations that support multiple media types (e.g. json vs event stream) which would require different client code.
The language part (shell, python, csharp) in the entries would rely on a registry we operate, since there doesn't seem to be an registry for programming languages other than implementations that are specific to platforms (e.g. linguist for GitHub)
The client part (curl, httpx, kiota) could either be another registry, or "free" for anybody to use as they which.
The version part is optional, and can be used in case multiple versions of the same client are being supported/showcased.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions