API Documentation
This bundle uses NelmioApiDocBundle to generate the API documentation.
Nearly all of the documentation is done via OpenApi Attributes (Swagger) in the corresponding
action/command and response entity classes, there is also the possibility to define (reusable) parameters, responses and schemas via yaml, for example:
# app/config/packages/nelmio_api_doc.yaml
nelmio_api_doc:
documentation:
components:
parameters:
myParameter:
name: myParameter
in: query
schema:
type: string
responses:
myResponse:
description: 'my Response'
content:
application/json:
schema:
$ref: '#/components/schemas/MySchema'
schemas:
MySchema:
type: object
properties:
myProperty:
type: string
example: 'myValue'
# etc.
Learn more about the components structure here: Components Structure
Predefined schemas
This bundle provides a few pre-defined schemas, for example RouteDocumentAttributes, NavigationPageCustomProperties, NavigationPageCustomHtmlAttributes and more.
The structure of some schemas cannot be known in advance, since it's allowed to put anything in there, and therefore the schema depends on the project's implementation. If they are in use, they must be defined/overridden in the project manually, for example:
# app/config/packages/nelmio_api_doc.yaml
nelmio_api_doc:
documentation:
components:
schemas:
NavigationPageCustomProperties:
type: array
items:
oneOf:
- type: string
- type: object
properties:
key:
type: string
value:
type: string
- $ref: '#/components/schemas/OpenDxpElement'
# etc.
NavigationPageCustomHtmlAttributes:
type: object
properties:
'data-custom-prop':
type: string
# etc.