AsyncAPI specs: enum with description

987 Views Asked by At

I am starting in programming and I need to update an asyncapi.yaml file including an enum of different statuses, and I am also being asked to add descriptions to each of them. While updating this new features to the openapi.yaml used the following schema: I can´t find related documentation to confirm that I am complying with the AsyncAPI specs. I got to some discusions regarding this situation but I just can´t get it clear.

Could you please help me defining if this schema complies with AsyncAPI spec? Any reference to documentation to clarify? Does OpenAPI and AsyncAPI adhere to same schemas or go in their own pace?

Please understand my level of english. Thank you!

SFCCOrderNotification:
  type: object
  properties:
    id:
      type: string
      description: The order's ID.
    created_at:
      type: string
      format: date-time
      description: The order's creation date.
    modified_at:
      type: string
      format: date-time
      description: The order's last modification date.
    status:
      $id: Status
      type: string
      description: |
        The order's status.
        * `submitted` - the customer has placed an order through e-commerce.
        * `received` - the order has been generated successfully. It has not yet been processed by the ERP.
        * `processing` - the order is somewhere between the integration in the ERP and the logistics operator's system. If it is taking a long time, there may have been a technical error in the communication. Requires manual action.
        * `pending_merchandise` - the order has been successfully integrated in the logistics operator but one or more items of the order are out of stock.
        * `picking` - the workers of the logistics operator are picking the order.
        * `cancelled` - the order has been cancelled manually.
      enum:
        - submitted
        - received
        - processing
        - pending_merchandise
        - picking
        - cancelled
    billing_address:
      $ref: '#/components/schemas/Address'
    order_items:
      type: array
      items:
        $ref: '#/components/schemas/OrderItem'
  required: [ id, status, modified_at, billing_address, order_items, shipments, payment_info, price_info ]
0

There are 0 best solutions below