[BUG] [PHP] oneOf problem with the similar field names in different models
See original GitHub issueBug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What’s the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Model have the similar fields (is_catchall and is_catch_all), after generation of api
openapi-generator version
5.0.1-SNAPSHOT
OpenAPI declaration file content or url
oneOf:
- $ref: '#/components/schemas/CheckIfEmailExistResult'
- $ref: '#/components/schemas/MailboxvalidatorResult'
- $ref: '#/components/schemas/PromptEmailVerificationApiResult'
...
is_catchall:
type: string
...
is_catch_all:
type: boolean
Steps to reproduce
docker run --rm -v ${PWD}/php:/local/out -v $(OPENAPI_PATH):/local/openapi.yaml openapitools/openapi-generator-cli:latest generate \
-i /local/openapi.yaml \
-g php \
-o /local/out/
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PHP model field validation broken on oneOf #12721 - GitHub
PHP model field validation broken on oneOf #12721. Open. dacgray opened this issue on Jun ... dacgray added the Issue: Bug label on...
Read more >How to use OpenAPI "oneOf" property with openapi-generator ...
I have been battling to generate a PHP client for an API that heavily uses anyOf and oneOf. After some googling and finding...
Read more >oneOf, anyOf, allOf, not - Swagger
The not keyword does not exactly combine schemas, but as all of the keywords mentioned above it helps you to modify your schemas...
Read more >Coming Soon To GraphQL: The oneof Input Object - StepZen
Learn about the upcoming oneof input object in GraphQL. ... Right now, to do this, we may need to create a separate field...
Read more >Java Generated Code | Protocol Buffers - Google Developers
If another non-repeated field has a name that conflicts with one of the repeated field's generated methods, then both field names will have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We recently merged a fix related to
ensureUniqueParams
. Please give it another try with the latest master.Looks like it’s true by default:
https://github.com/OpenAPITools/openapi-generator/blob/1006d2f21e41cf2f78f3e984fd8dd1127c392cbd/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L207