Purpose
It allows you to specify exactly what data your endpoint expects, where it should be located (Body, Query, or Path), and what validation rules apply to it. This information is then used by the framework for:- Automatic Validation: via
RequestValidationMiddleware. - IDE Autocompletion: via
DocBlockGenerator. - OpenAPI Export: via
OpenAPIGenerator.
Structure
The class separates properties into three distinct bags:1. Body Properties
Used for data sent in the request body (JSON, XML, or Form Data).2. Query Properties
Used for data sent in the URL query string (e.g.,?search=term).
3. Path Properties
Used for data embedded in the URL path (e.g.,/users/{id}).
Helper Methods
addPaginationQueryProperties()
A convenience method that adds a non-required, integer page query parameter to the documentation. This is commonly used in combination with the Paginator utility.