elements icon indicating copy to clipboard operation
elements copied to clipboard

User story: custom code samples

Open rattrayalex opened this issue 2 years ago • 2 comments

User Story Description

As an API provider who offers SDKs for my API,

I want to include code snippets demonstrating those SDKs for each API request,

so I can make my users integrations much easier.

Acceptance Criteria

  • [ ] Read from a property like x-codeSamples in the OAS for each operation with something like a hash like {go: '…', node: '…', python: '…'} (no opinions here)
  • [ ] Display that instead of the default for the given language

Notes

  1. this was originally filed within https://github.com/stoplightio/elements/issues/2175 which was closed as stale
  2. This is a feature that ReadMe.com offers as x-readme.code-samples, and I think Redoc supports as well.

Sprint Ready Checklist

  • [ ] Acceptance criteria defined
  • [ ] Team understands acceptance criteria
  • [ ] Team has defined solution / steps to satisfy acceptance criteria
  • [ ] Acceptance criteria is verifiable / testable
  • [ ] External / 3rd Party dependencies identified

rattrayalex avatar Nov 18 '23 22:11 rattrayalex

@rattrayalex I have been working on a PR to support an initial round of the x-codeSamples vendor extension

weyert avatar Apr 25 '24 15:04 weyert

This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (STOP-492) has been created.

github-actions[bot] avatar Apr 26 '24 16:04 github-actions[bot]

I assume this is now fixed in https://github.com/stoplightio/elements/pull/2574 – thank you @weyert !

rattrayalex avatar May 27 '24 01:05 rattrayalex