|
|
4 years ago | |
|---|---|---|
| .. | ||
| example-object | 4 years ago | |
| misc | 4 years ago | |
| openapi-spec | 4 years ago | |
| petstore-3.0 | 4 years ago | |
| petstore.swagger.io | 4 years ago | |
| schema-query-parameter-processor | 4 years ago | |
| swagger-spec | 4 years ago | |
| using-interfaces | 4 years ago | |
| using-refs | 4 years ago | |
| using-traits | 4 years ago | |
| Readme.md | 4 years ago | |
Readme.md
Code/Annotation examples
Collection of code/annotation examples and their corresponding OpenAPI specs generated using swagger-php.
-
openapi-spec
Implementation of the OpenAPI v3 example specs using swagger-php annotations.
-
petstore.swagger.io
The swagger-ui petstore example using swagger-php annotations.
-
swagger-spec
Some more examples based on the (now defunct) swagger-api specs.
-
Other
- simple response object: source / spec
- misc: source / spec
- using interfaces: source / spec (inherit) / spec (merge)
- using traits: source / spec (inherit) / spec (merge)
- using refs: source / spec
Custom processors
Processors implement the various steps involved in converting annotations into an OpenAPI spec.
Writing a custom processor is the recommended way to extend swagger-php in a clean way.
Processors are expected to implement the __invoke() method expecting the current Analysis object as single parameter:
<?php
...
use OpenApi\Analysis;
...
class MyCustomProcessor
{
public function __invoke(Analysis $analysis)
{
// custom processing
}
}
-
schema-query-parameter-processor
A processor that takes a vendor tag (expecting a schema
#ref) and injects all properties of that given schema as query parameter to the request definition.