Skip to content

Commit

Permalink
Adjust README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yceruto committed Dec 28, 2023
1 parent d577a66 commit 6082a13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ Define your OpenAPI spec and endpoint at the same time:
```php
<?php

namespace Api\Catalog\Endpoint;
namespace Api\Catalog\Controller;

use Api\Catalog\Model\Product;
use OpenSolid\OpenApiBundle\Attribute\Body;
use OpenSolid\OpenApiBundle\Routing\Attribute\Post;

class PostProductEndpoint
class PostProductAction
{
#[Post('/products')]
public function handle(#[Body] PostProductBody $body): Product
public function __invoke(#[Body] PostProductBody $body): Product
{
return new Product($body->name);
}
Expand Down

0 comments on commit 6082a13

Please sign in to comment.