swagger-api / swagger-api/swagger-codegen
[lang php] incorrect return type in PHPDoc rot arrays of objects
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Generated code:
/**
* Gets sessions
*
* @return map[string,\Model\Session]
*/
public function getSessions()
{
return $this->container['sessions'];
}
But PHPDoc don't support map[string,\Model\Session] format. Need use \Model\Session[] instead.
https://docs.phpdoc.org/3.0/guide/guides/types.html
Swagger-codegen version
swagger-codegen-cli-3.0.22.jar
Swagger declaration file content or url
Command line used for generation
docker run --rm -v ${PWD}:/local -w /local openjdk java -jar swagger-codegen-cli.jar generate --input-spec /local/openapi.yaml --lang php --output /local/out/ -c /local/openapi-codegen-php.json
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
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
Locate the PHP generator or template that emits @return annotations, then reproduce the report with the supplied Docker command and a matching OpenAPI input. Done means generated PHPDoc uses PHPDoc-compatible array-of-object syntax instead of map[string,Model\Session], with relevant generator tests updated or added if they exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100