Agent Testing
FAQ

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

    owasp-string-limit


    Formats: Severity:

    This rule checks schemas used in requests, including parameters and request bodies. Response-only and unused schemas are excluded.

    Bad example

    openapi: "3.1.0"
    info:
      title: Chicken Nuggets API
      version: "1.0"
    paths:
      /chickenNuggets:
        post:
          requestBody:
            content:
              application/json:
                schema:
                  type: string
          responses:
            '201':
              description: Created
    

    Good example

    openapi: "3.1.0"
    info:
      title: Chicken Nuggets API
      version: "1.0"
    paths:
      /chickenNuggets:
        post:
          requestBody:
            content:
              application/json:
                schema:
                  type: string
                  maxLength: 99
          responses:
            '201':
              description: Created
    

    How do I fix this violation?

    Set maxLength, or use enum or const to restrict the accepted values.