Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sören committed Sep 21, 2022
1 parent 69990f9 commit a4be3a5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Adapter that reads [OpenApi](https://spec.openapis.org) schema and add included routes to [Slim](https://www.slimframework.com).

Current version supports PHP `^7.4 | ^8.0`.
Current version supports PHP `^7.4|^8.0`.

## Installation

Expand Down Expand Up @@ -33,13 +33,13 @@ $openapi->route($slim);
## How to define controllers

In order for automatic mapping to work, the `operationId` must be set on all defined routes in OpenApi source.
If no method is specified, class method `::invoke()` will be called on class.
If no method is specified, class method `__invoke()` will be called on class.

| With invoke | With method |
| --- | --- |
| `Classname` | `Classname:httpMethod` |
| `Namespace/Classname` | `Namespace/Classname:httpMethod` |
| `Namespace\\Classname` | `Namespace\\Classname:httpMethod` |
| `Classname` | `Classname:method` |
| `Namespace/Classname` | `Namespace/Classname:method` |
| `Namespace\\Classname` | `Namespace\\Classname:method` |

### Example

Expand All @@ -50,7 +50,7 @@ If no method is specified, class method `::invoke()` will be called on class.
"/test": {
"get": {
"operationId": "Test/MyController",
"description": "Will invoke class Test\\MyController"
"description": "Will invoke on class Test\\MyController"
},
"put": {
"operationId": "Test\\MyController:put",
Expand Down

0 comments on commit a4be3a5

Please sign in to comment.