swagger-api / swagger-api/swagger-codegen
PHP Client SDK generates classes only for the first specified media type
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
API spec contains multiple media types for the same response (application/json and application/xml). However, generated PHP Client SDK creates only classes that work with xml models.

Swagger-codegen version
v. 3.0.27 for OpenAPI 3.0
Swagger declaration file content or url
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
Suggest a fix/enhancement
Response for applications/json stands first, so I assume this might be the possible reason.

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 provided OpenAPI 3.0 response containing both application/json and application/xml, then generate the PHP Client SDK with swagger-codegen v3.0.27 and compare the resulting models. Done means the generated SDK supports classes for both media types rather than only the first or XML models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, php
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100