FAQ

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

    asyncapi-server-security


    Formats: Severity:

    asyncapi-server-security checks security requirements declared by servers.

    Why did this violation appear?

    A server security entry names a scheme that is not declared under components.securitySchemes, or a $ref points somewhere else.

    Bad example

    asyncapi: 3.1.0
    servers:
      production:
        host: events.example.com
        protocol: mqtt
        security:
          - missingAuth: []
    components:
      securitySchemes: {}
    

    Good example

    asyncapi: 3.1.0
    servers:
      production:
        host: events.example.com
        protocol: mqtt
        security:
          - apiKey: []
    components:
      securitySchemes:
        apiKey:
          type: apiKey
          in: user
          name: api_key
    

    How do I fix this violation?

    Declare every scheme used by server security or update the server to use an existing scheme.