Integrations
| Framework / OpenApi object | Specification (separate openapi-file) | Specification info | Tag | Tag info | Action (endpoint + method) | Action parameters | Action result |
|---|---|---|---|---|---|---|---|
| Yii2 | Module (@alias if present, folder name otherwise) / application |
Module: @description, @docs |
Controller: class name: CamelCaseController to camel-case | Controller: @title, @description, @docs |
Controller’s (child of yii\web\Controller) method or separate action (defined in controller actions()) |
Of class or method: @alias, @auth, @param, @paramExample, @paramEnum, @paramFormat |
@result |
| Slim | All methods | None | All path parts to action but last one | Children of App\Application\Actions\Action |
Of method action of Action class: @alias, @param, @paramExample, @paramEnum, @paramFormat |
@result |
|
| Laravel | All methods | None | All path parts to action but last one | Methods in children of \Illuminate\Routing\Controller |
Of method of controller class: @alias, @param, @paramExample, @paramEnum, @paramFormat |
@result |
Yii2
Will be parsed all application and modules controllers for inline and external actions:
| Yii2 entity | OpenApi entity | id | phpDoc tags |
|---|---|---|---|
| Every module | a specification (separate openapi-specification file) | @alias if present, folder name otherwise | @alias, @description, @docs |
| Every controller | a section (tag in openapi terms) | class name: CamelCaseController to lower/case | @title, @description, @docs |
Every controller action (actionNNN() method or entry in actions()) |
an endpoint | @alias if present, NNNN from actionNNNN name if inline, key from actions() otherwise |
@alias, @auth, @param, @paramExample, @paramEnum, @paramFormat, @result |
Options:
bool $scrapeModules,bool $scrapeApplication- scan modules or/and application controllersbool $scanControllerInlineActions,bool $scanControllerExternalActions- scan inline or/and external actions in controllersbool $useActionMarshallerAsResult- use an external action’smarshallerclass as the response schema instead of the action’s@returntype. Disabled by default.?string $marshallerBaseClass- optionally identify a shared marshaller base class; when enabled, public implementation properties are excluded and@propertytags describe the response fields.
For example, configure the scraper when the marshaller’s PHPDoc describes the serialized response:
class ApiScraper extends Yii2CodeScraper
{
public bool $useActionMarshallerAsResult = true;
public ?string $marshallerBaseClass = App\Components\Marshaller::class;
}
The scraper reads the marshaller action property (or its action configuration override). Its value must be a loadable class name, an object instance, or a Yii object configuration containing class. The action return type remains the fallback when no marshaller can be resolved.