docs/reference/processors.md
This page is generated automatically from the swagger-php sources.
For improvements head over to GitHub and create a PR ;)
Processors are listed in the default order of execution.
The -c option takes a name/value pair: the processor name (starting lowercase)
and the option name, separated by a dot (.).
To list the available processor names and options use -D. It still requires a
source path, e.g. ./vendor/bin/openapi -D src. Unknown keys are
reported as warnings.
> ./vendor/bin/openapi -c operationId.hash=true src
> ./vendor/bin/openapi -c pathFilter.tags[]=/pets/ -c pathFilter.tags[]=/store/ src
Configuration can be set using the Generator::setConfig() method. Keys can either be the same
as on the command line or be broken down into nested arrays.
(new Generator())
->setConfig([
'operationId.hash' => true,
'pathFilter' => [
'tags' => [
'/pets/',
'/store/',
],
],
]);
Checks if the annotation has a summary and/or description property and uses the text in the comment block (above the annotations) as summary and/or description.
Use <code>null</code>, for example <code>@Annotation(description=null)</code>, if you don't want the annotation to have a description.
Merge all <code>@OA\OpenApi</code> annotations into one.
bool · default: false@OA\Components annotations to be merged.Merge reusable annotation into <code>@OA\Schemas</code>.
Iterate over the chain of ancestors of a schema and:
Look at all (direct) interfaces for a schema and:
Look at all (direct) traits for a schema and:
Expands PHP enums.
Determines <code>schema</code>, <code>enum</code> and <code>type</code>.
expandEnums.enumNames : string · default: null
Specifies the name of the extension variable where backed enum names will be stored.
Set to <code>null</code> to avoid writing backed enum names.
Example: <code>->setEnumNames('enumNames')</code> yields:
x-enumNames:
- NAME1
- NAME2
Use the Schema context to extract useful information and inject that into the annotation.
Merges properties.
Use the RequestBody context to extract useful information and inject that into the annotation.
Use the property context to extract useful information and inject that into the annotation.
Use the property context to extract useful information and inject that into the annotation.
Build the openapi->paths using the detected <code>@OA\PathItem</code> and <code>@OA\Operation</code> (<code>@OA\Get</code>, etc).
Augments shared and operations parameters from docblock comments.
bool · default: trueUse the Schema context to extract useful information and inject that into the annotation.
Merges properties.
Split JsonContent into Schema and MediaType.
Split XmlContent into Schema and MediaType.
Augment media type encodings.
Generate the OperationId based on the context of the OpenApi annotation.
bool · default: trueAllows to filter endpoints based on tags and/or path.
If no <code>tags</code> or <code>paths</code> filters are set, no filtering is performed.
All filter (regular) expressions must be enclosed within delimiter characters as they are used as-is.
array · default: []array · default: []Tracks the use of all <code>Components</code> and removed unused schemas.
bool · default: falseEnsures that all tags used on operations also exist in the global <code>tags</code> list.
array · default: []bool · default: true