swagger-api / swagger-api/swagger-codegen
[PHP] oneOf miss mapping types
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
This problem appeared also in javascript.
Generation sdk for file creates invalid EmailResponse model.
oneOf:
- $ref: '#/components/schemas/CheckIfEmailExistResult'
- $ref: '#/components/schemas/MailboxvalidatorResult'
- $ref: '#/components/schemas/PromptEmailVerificationApiResult'
Types and formats were not generated in EmailResponse.
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerFormats = [
];
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 referenced ev.openapiv3.yaml oneOf declaration at line 227 and the generated php/SwaggerClient-php/lib/Model/EmailResponse.php output. Reproduce generation with the documented Docker command and inspect how the PHP generator handles this schema; done means EmailResponse contains the expected type and format mappings for the oneOf entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, php
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100