swagger-api / swagger-api/swagger-codegen
php-symfony doesn't set return model in doc-comment
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Hello!
I tried to create controllers interfaces and expect to see file like this https://github.com/swagger-api/swagger-codegen/blob/master/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php.
But after generation, i dont' see @return Swagger\Server\Model\Pet[]
/**
* Operation findPetsByStatus
*
* Finds Pets by status
*
* @param array $status Status values that need to be considered for filter (required)
* @param int &$responseCode The HTTP Response Code
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return array|object|null
*/
public function findPetsByStatus(array $status, int &$responseCode, array &$responseHeaders): array|object|null;`
instead of:
/**
* Operation findPetsByStatus
*
* Finds Pets by status
*
* @param string[] $status Status values that need to be considered for filter (required)
* @param integer $responseCode The HTTP response code to return
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*
* @return Swagger\Server\Model\Pet[]
*
*/
public function findPetsByStatus(array $status, &$responseCode, array &$responseHeaders);
Could you help me and say where is my mistake?
Swagger-codegen version
I tried to use v6.6.0 and latest version. Nothing happens.
Swagger declaration file content or url
I used content of file https://petstore.swagger.io/v2/swagger.json.
Command line used for generation
docker run --rm \
-v /path/to/project:/local openapitools/openapi-generator-cli generate \
-i /local/tmp/swagger.json \
-g php-symfony \
-o /local/tmp/swagger-generated
Steps to reproduce
docker run --rm \
-v /path/to/project:/local openapitools/openapi-generator-cli generate \
-i /local/tmp/swagger.json \
-g php-symfony \
-o /local/tmp/swagger-generated
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the generated php-symfony Api/PetApiInterface.php with the referenced petstore sample, starting by running the Docker generation command from the issue. Trace the template or generator input responsible for the method doc-comment, and consider the issue done when the generated findPetsByStatus declaration includes the expected Swagger\Server\Model\Pet[] return annotation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100