swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.41k stars 8.93k forks source link

Would like the ability to create code snippets in various languages using swagger-ui-react #6256

Closed johnwhitton closed 3 years ago

johnwhitton commented 4 years ago

Content & configuration

Swagger/OpenAPI definition: emasset.api.v1.swagger.json.txt

Swagger-UI configuration options:

swagger.js.txt

Is your feature request related to a problem?

Would like the ability to create code snippets in various languages using swagger-ui-react.

Describe the solution you'd like

I would like to be able to use swagger-ui to create code examples in various languages. Ideally this could be configured using extensions in the openapi document and would be displayed via swagger-ui-react. As an example you can see this document

Screen Shot 2020-07-22 at 3 34 37 PM

Having a look at this functionality it appears to have been built as follows

Describe alternatives you've considered

Currently we're using

Additional context

I'd like to thank and send encouragement to the team for building out this highly useful software. It looks like a number of teams are using this in conjunction with docusarus Some of which are running into this build issue

mathis-m commented 3 years ago

With this PR #6910 the cURL part is already refactored to the style shown here.