FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • ✨ New! Try the OpenAPI Doctor ✨ The OpenAPI Doctor
    Recommended

    asyncapi-3-headers-schema-type-object


    Formats: Severity:

    asyncapi-3-headers-schema-type-object checks that message and message-trait headers are modeled as objects.

    Why did this violation appear?

    A headers schema is missing type: object or declares another type.

    Bad example

    asyncapi: 3.1.0
    components:
      messages:
        UserCreated:
          headers:
            type: string
    

    Good example

    asyncapi: 3.1.0
    components:
      messages:
        UserCreated:
          headers:
            type: object
            properties:
              traceId:
                type: string
    

    How do I fix this violation?

    Model headers as an object with named properties for each header.