-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from DoclerLabs/add-include-tags-and-exclude-…
…tags add include and exclude tags
- Loading branch information
Showing
10 changed files
with
161 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
test/suite/functional/Generator/Client/SwaggerPetstoreClientWithTags.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file was generated by docler-labs/api-client-generator. | ||
* | ||
* Do not edit it manually. | ||
*/ | ||
|
||
namespace Test; | ||
|
||
use Psr\Container\ContainerInterface; | ||
use Psr\Http\Client\ClientInterface; | ||
use Psr\Http\Message\ResponseInterface; | ||
use Test\Request\AddPetRequest; | ||
use Test\Request\CountPetsRequest; | ||
use Test\Request\FindPetsRequest; | ||
use Test\Request\Mapper\RequestMapperInterface; | ||
use Test\Request\RequestInterface; | ||
use Test\Response\ResponseHandler; | ||
use Test\Schema\Mapper\PetCollectionMapper; | ||
use Test\Schema\Mapper\PetMapper; | ||
use Test\Schema\Pet; | ||
use Test\Schema\PetCollection; | ||
|
||
class SwaggerPetstoreClient | ||
{ | ||
public function __construct(private readonly ClientInterface $client, private readonly ContainerInterface $container) | ||
{ | ||
} | ||
|
||
public function sendRequest(RequestInterface $request): ResponseInterface | ||
{ | ||
return $this->client->sendRequest($this->container->get(RequestMapperInterface::class)->map($request)); | ||
} | ||
|
||
public function findPets(FindPetsRequest $request): PetCollection | ||
{ | ||
$response = $this->handleResponse($this->sendRequest($request)); | ||
|
||
return $this->container->get(PetCollectionMapper::class)->toSchema($response); | ||
} | ||
|
||
public function addPet(AddPetRequest $request): Pet | ||
{ | ||
$response = $this->handleResponse($this->sendRequest($request)); | ||
|
||
return $this->container->get(PetMapper::class)->toSchema($response); | ||
} | ||
|
||
public function countPets(CountPetsRequest $request): void | ||
{ | ||
$this->handleResponse($this->sendRequest($request)); | ||
} | ||
|
||
protected function handleResponse(ResponseInterface $response) | ||
{ | ||
return $this->container->get(ResponseHandler::class)->handle($response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters