Skip to content

RequestBody content validation leads to nil reference (panic) #731

@malud

Description

@malud

If someone has a wrong indentation for the requestBody content property the validation will panic while accessing this content field.

paths:
  /your-path:
    post:
      requestBody:
        description: A JSON object containing...
        required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                nullable: true
                type: integer

Leads to panic at:

content := requestBody.Content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions