github.com/Axway/agent-sdk@v1.1.101/pkg/apic/testdata/asyncapi-sample.yaml (about)

     1  asyncapi: "2.0.0"
     2  info:
     3    title: AsyncAPI Sample
     4    version: "1.0.0"
     5    description: |
     6      This is a simple example of an _AsyncAPI_ document.
     7  
     8  servers:
     9    prod:
    10      url: api.company.com:{port}
    11      description: Allows you to connect using the MQTT protocol.
    12      protocol: mqtt
    13      variables:
    14        port:
    15          enum:
    16            - '5676'
    17            - '5677'
    18          default: '5676'
    19      bindings: 
    20        solace: 
    21          msgVpn: apim-test
    22          version: 0.2.0
    23  
    24  channels:
    25    accounts.1.0.action.user.signup:
    26      description: Accounts user signup
    27      subscribe:
    28        summary: Receives user signup
    29        operationId: userSignUp
    30        message:
    31          $ref: "#/components/messages/userSignUp"
    32      publish:
    33        operationId: userSignedUp
    34        message:
    35          $ref: "#/components/messages/userSignedUp"
    36  
    37  components:
    38    messages:
    39      userSignUp:
    40        deprecated: true
    41        summary: Action to sign a user up.
    42        description: |
    43          Multiline description of what this action does. **It allows Markdown.**
    44        tags:
    45          - name: user
    46          - name: signup
    47        headers:
    48          type: object
    49          properties:
    50            qos:
    51              $ref: "#/components/schemas/MQTTQoSHeader"
    52            retainFlag:
    53              $ref: "#/components/schemas/MQTTRetainHeader"
    54        payload:
    55          type: object
    56          properties:
    57            user:
    58              $ref: "#/components/schemas/userCreate"
    59            signup:
    60              $ref: "#/components/schemas/signup"
    61  
    62  
    63      userSignedUp:
    64        payload:
    65          type: object
    66          properties:
    67            test:
    68              type: array
    69              items:
    70                type: object
    71                properties:
    72                  key1:
    73                    type: string
    74                  key2:
    75                    type: integer
    76            user:
    77              $ref: "#/components/schemas/user"
    78            signup:
    79              $ref: "#/components/schemas/signup"
    80    schemas:
    81      id:
    82        title: id
    83        description: Resource identifier
    84        type: string
    85      username:
    86        title: username
    87        description: User handle
    88        type: string
    89      datetime:
    90        title: datetime
    91        description: Date and Time of the message
    92        type: string
    93        format: date-time
    94      MQTTQoSHeader:
    95        title: qos
    96        description: Quality of Service
    97        type: integer
    98        format: int32
    99        default: 1
   100        enum:
   101          - 0
   102          - 2
   103      MQTTRetainHeader:
   104        title: retainFlag
   105        description: |
   106          This flag determines if the message will be saved by the broker for the specified
   107          topic as last known good value. New clients that subscribe to that topic will receive
   108          the last retained message on that topic instantly after subscribing. More on retained
   109          messages and best practices in one of the next posts.
   110        type: boolean
   111        default: false
   112      user:
   113        type: object
   114        required:
   115          - id
   116          - username
   117        properties:
   118          id:
   119            description: User Id
   120            $ref: "#/components/schemas/id"
   121          full_name:
   122            description: User full name
   123            type: string
   124          username:
   125            $ref: "#/components/schemas/username"
   126      userCreate:
   127        type: object
   128        required:
   129          - username
   130        properties:
   131          full_name:
   132            description: User full name
   133            type: string
   134          username:
   135            $ref: "#/components/schemas/username"
   136  
   137      signup:
   138        type: object
   139        required:
   140          - method
   141          - datetime
   142        properties:
   143          method:
   144            description: Signup method
   145            type: string
   146            enum:
   147              - email
   148              - facebook
   149              - twitter
   150              - github
   151              - google
   152          datetime:
   153            $ref: "#/components/schemas/datetime"