owasp-no-numeric-ids
OWASP API1:2019 - Use random IDs that cannot be guessed. UUIDs are preferred
Set the format
to be uuid.
Bad example
openapi: "3.1.0"
paths:
/fish/{id}/:
get:
description: "get"
parameters:
- name: id
in: path
schema:
type: integer
Good Example
openapi: "3.1.0"
paths:
/fish/{id}/:
get:
description: "get"
parameters:
- name: id
in: path
schema:
type: string
format: uuid
How do I fix this violation?
For any parameter which ends in id, use type string with uuid
format instead of type integer.