Overview
For developers who prefer docblocks over PHP 8 attributes, Geni reads the PHPDoc of each controller method. The first paragraph becomes the operation title and the rest its description:Summary and Description
The free text of the docblock (everything before the tags) is split into two parts:- Summary: the first paragraph, with trailing periods removed.
List published articles.becomes the operation summaryList published articles. - Description: everything after the first blank line.
Precedence
When several sources define the title or description, Geni uses the first one it finds:#[Endpoint(title: ..., description: ...)]@summarytag (summary only) and@descriptiontag (description only)- The PHPDoc text (first paragraph and the rest)
- The route name (summary fallback, for example
api.projects.index)
Markdown
Descriptions support a safe Markdown subset in the built-inblade portal: paragraphs, lists, headings, fenced code blocks, inline code, bold, italic and http(s) or relative links. Raw HTML is shown as text. Other renderers (Scalar, Stoplight Elements) render descriptions with their own Markdown support. See Documentation Renderers.
Supported Tags
Operation Metadata
@tags TagName, AnotherTag: Assigns the operation to OpenAPI tags.@operationId customOperationId: Sets theoperationIdexplicitly. Without it, Geni generates one; see Operation IDs.@summary Text: Sets the operation summary, overriding the first docblock paragraph. A trailing period is removed.@description Text: Sets the operation description, overriding the docblock paragraphs.@deprecated [message]: Marks the operation as deprecated.@unauthenticated: Omits security requirements for this specific endpoint.@ignoreParam name: Leaves a parameter out of the documentation.@requestMediaType type: Sets the request body media type.
Responses
-
@response [status] Type [description]: Documents the success response. The status defaults to200.@response ArticleResource@response 201 ArticleResource Article created
{data: ArticleResource}). -
@status 201together with@body Type: An alternative way to declare the success status and type. -
@throws ExceptionClass: Adds an error response inferred from the exception type (for exampleValidationExceptionmaps to 422,AuthenticationExceptionto 401,AuthorizationExceptionto 403,ModelNotFoundExceptionto 404). Map your own exceptions withwithExceptionResponses().
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.