Skip to content

vodevel/api-doc-bundle-type-describer

Repository files navigation

PoC

Describer to the nelmio/api-doc-bundle using method signature (types)

Install

composer require vodevel/api-doc-bundle-type-describer

Usage

Unfortunately, it doesn't work without a Tag attribute yet, don't forget to add it.

Replacing

class Controller {
    #[Route('api/example', methods: ['POST'])]
    #[RequestBody(content: new Model(type: ExampleRequest::class))]
    #[Response(
        response: 200,
        description: '',
        content: new Model(type: ExampleResponse::class),
    )]
    #[Tag(name: 'example')]
    public function exampleMethod(ExampleRequest $request): ExampleResponse {
        return new ExampleResponse();
    }
}

With

class Controller {
    #[Route('api/special', methods: ['POST'])]
    #[Tag(name: 'example')]
    public function exampleMethod(ExampleRequest $request): ExampleResponse {
        return new ExampleResponse();
    }
}

#[RequestBody]
class SpecialPointRequest {}

#[Response]
class SpecialPointResponse {}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages