swagin icon indicating copy to clipboard operation
swagin copied to clipboard

x-codeSamples integration

Open gsbecerrag opened this issue 1 year ago • 0 comments

This is more a question than an actual issue, but I think it is important to provide code samples to distribute the API docs directly in production, is there a way to use code sample objects? if anyone can point me in the right direction I can work in this functionality, as the official docs this object works like this in the API definition:

Redocly Documentation

openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      x-codeSamples:
        - lang: 'cURL'
          label: 'CLI'
          source: |
            curl --request POST \
            --url 'https://data.apiexample.com/api/example/batch_query/json?format=json' \
            --header 'content-type: application/octet-stream: ' \
            --data '{}'

gsbecerrag avatar Aug 29 '22 00:08 gsbecerrag