swagger-api / swagger-api/swagger.io-docs

Syntax issues with callback examples

Open
#345 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triaged
Dominant language
Astro
Stars
1.6k
Forks
407
Avg merge
2m
Merged PRs (30d)
2

Description

I believe that there are a few syntax issues (mainly indentations) with the example provided here and that the complete example should be:

openapi: 3.0.0
info:
  version: 0.0.0
  title: test
paths:
  /subscribe:
    description: Add a subscriber
    post:
      parameters:
        - name: callbackUrl
          in: query
          required: true
          schema:
            type: string
            format: uri
        - name: event
          in: query
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Added
          content:
            application/json:
              schema:
                type: object
                properties:
                  subscriberId: 
                    type: string
                    example: AAA-123-BBB-456                    
          links:  # Link the returned id with the unsubscribe operation
            unsubscribeOp:
              operationId: unsubscribeOperation
              parameters: 
                Id: $response.body#/subscriberId
      callbacks:
        myEvent:
          '{$request.query.callbackUrl}?event={$request.query.event}':
            post:
              requestBody:
                content:
                  application/json:
                    example:
                      message: Some event
              responses:
                '200':
                  description: OK
              
  /unsubscribe:
    post:
      operationId: unsubscribeOperation
      parameters:
        - name: Id
          in: query
          required: true
          schema:
            type: string
      responses:
        200:
          description: OK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the linked callbacks documentation page and the supplied YAML as the reference; locate the page's source in swagger.io-docs and compare the example's indentation and syntax. Done means the published callback example matches the corrected complete example.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.