swagger-api / swagger-api/swagger-codegen
PHP client SDK response elements are re-written and converted to lower case in all models
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Our API input specifies input fields in mixed case, such as, SO_SystemID. The generated model's $attributeMap has the entry, which matches our API response:
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $attributeMap = [
'so_system_id' => 'SO_SystemID',
However, the SDK response returns the lower-case element name, which is not what is expected.
Swagger-codegen version
3.0.54
Swagger declaration file content or url
Command line used for generation
I don't have the command line, we use SwaggerHub to Export a PHP client SDK.
Steps to reproduce
Use SwaggerHub Export after importing a valid YAML file.
Related issues/PRs
Nothing found.
Suggest a fix/enhancement
We need the SDK to respond with the CamelCase fields returned by our API.
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
Reproduce the issue by exporting a PHP client SDK from SwaggerHub using the mixed-case fields shown in the report, then trace how the PHP client uses the model's $attributeMap during response deserialization. Done means response elements retain the API's CamelCase names instead of being rewritten to lower case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- 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