FAQ

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

    owasp-string-limit


    Formats: Severity:

    String size should be limited to mitigate resource exhaustion attacks. This can be done using maxLength, enum or const.

    Bad example

    openapi: "3.1.0"
    info:
      version: "1.0"
    components:
      schemas:
        Foo:
          type: string
    

    Good Example

    openapi: "3.1.0"
    info:
      version: "1.0"
    components:
      schemas:
        Foo:
          type: string
          maxLength: 99
    

    How do I fix this violation?

    Use maxLength, enum, or const to define the size/limit of the value.