Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax issues with callback examples #345

Open
lodup29 opened this issue Mar 17, 2024 · 0 comments
Open

Syntax issues with callback examples #345

lodup29 opened this issue Mar 17, 2024 · 0 comments

Comments

@lodup29
Copy link

lodup29 commented Mar 17, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant