Overview
For developers who prefer docblocks over PHP 8 attributes, Geni provides comprehensive support for standard PHPDoc annotations. Geni supports familiar docblock conventions, making it easy to migrate from other tools:Supported Tags
Operation Metadata
- Summary & Description: The first line of the docblock is treated as the summary. Subsequent lines before tags are treated as the long description.
@tags TagName, AnotherTag: Assigns operations to OpenAPI tags.@operationId customOperationId: Explicitly assigns anoperationId.@deprecated: Marks the operation as deprecated.@unauthenticated: Omits security requirements for this specific endpoint.
Parameters
@queryParam name type Description: Documents a query parameter.@pathParam name type Description: Documents a path parameter.@headerParam name type Description: Documents a request header parameter.
Responses
@response status Type: Documents a response status and schema type.@response 200 ArticleResource@response 200 ArticleResource[]@response 201 {"id": 1, "status": "created"}@response 204 No Content
@throws ExceptionClass: Automatically infers error status codes from exception types (e.g.ModelNotFoundExceptionmaps to 404).
Precedence Rules
When both inferred data and explicit annotations are present, Geni applies the following priority order:- PHP 8 Attributes: Highest priority. Overrides all other sources.
- PHPDoc Annotations: Second priority. Overrides inferred data.
- Static Inference: Lowest priority. Used when no explicit annotations are provided.