You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,25 +124,25 @@ documentation:
124
124
You can define your documentation programmatically using PHP classes. This offers strong typing and IDE autocompletion.
125
125
126
126
1. Create a class that implements `Ehyiah\ApiDocBundle\Interfaces\ApiDocConfigInterface`.
127
-
2. Add the `#[ApiDocComponent]` attribute with a unique `id`.
127
+
2. Add the `#[ApiDocConfig]` attribute with a unique `component` name.
128
128
3. Implement the `configure` method.
129
129
4. Your class is automatically autoloaded and parsed.
130
130
131
-
The `#[ApiDocComponent]` attribute is **required**. It lets the TUI find and edit your component regardless of file location or class name.
131
+
The `#[ApiDocConfig]` attribute lets the DI registry find your component regardless of file location or class name.
132
132
133
-
- **`id`** — A unique string that identifies this component. Use the same name as the OpenAPI component key (e.g., for a schema named `User`, use `id: 'User'`). For routes, use the route name (e.g., `id: 'api_users'`).
134
-
- **`type`** — Optional. A hint for the TUI (e.g., `'schema'`, `'response'`, `'tag'`). Auto-detected in most cases.
133
+
- **`component`** — A unique string that identifies this component. Use the same name as the OpenAPI component key (e.g., for a schema named `User`, use `component: 'User'`). For routes, use the route name (e.g., `component: 'api_users'`).
134
+
- **`type`** — The component type (e.g., `'schemas'`, `'responses'`, `'routes'`).
135
135
136
136
**Example `src/ApiDoc/UserDocConfig.php`:**
137
137
```php
138
138
<?php
139
139
namespace App\ApiDoc;
140
140
141
-
use Ehyiah\ApiDocBundle\Attributes\ApiDocComponent;
141
+
use Ehyiah\ApiDocBundle\Attributes\ApiDocConfig;
142
142
use Ehyiah\ApiDocBundle\Builder\ApiDocBuilder;
143
143
use Ehyiah\ApiDocBundle\Interfaces\ApiDocConfigInterface;
0 commit comments