swagger-api / swagger-api/swagger-codegen
[PHP] allOf problem with the same field names in different models
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
To try resolve problem https://github.com/swagger-api/swagger-codegen/issues/10896 in yaml try to use allOf; Codegen creates duplications methods.
protected static $getters = [
....
'is_catchall' => 'getIsCatchall',
....
'is_catch_all' => 'getIsCatchAll',
.... ];
public function getIsCatchall()
{
return $this->container['is_catchall'];
}
public function getIsCatchAll()
{
return $this->container['is_catch_all'];
}
Swagger-codegen version
3.0.24
Swagger declaration file content or url
Command line used for generation
docker run --rm -v ${PWD}/php:/local/out -v $(OPENAPI_PATH):/local/openapi.yaml swaggerapi/swagger-codegen-cli-v3:latest generate \
-i /local/openapi.yaml \
-l php \
-o /local/out/
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
Start with the OpenAPI declaration at the linked ev.openapiv3.yaml location and reproduce generation with the documented Docker command using swagger-codegen-cli-v3:latest. Inspect the generated PHP getters and static getter map; done means an allOf case with the two field names does not create duplicate methods or mappings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, php
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100