question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] [PHP] oneOf problem with the similar field names in different models

See original GitHub issue

Bug 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

https://github.com/go-email-validator/email-validator-sdk/blob/e99fe82d3c9d6d520687cf499688112e86acfe03/ev.openapiv3.yaml#L227

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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wing328commented, Mar 10, 2021

We recently merged a fix related to ensureUniqueParams. Please give it another try with the latest master.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found