OpenAPITools / OpenAPITools/openapi-generator
[BUG][PHP] single quotes in path should be escaped
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
After generation i end up with php errors because the single quotes in the path are not escaped.
$resourcePath = '/Accounts('{AccountID}')';
This is the path in the openapi.json
"/Accounts('{AccountID}')"
openapi-generator version
latest openapitools/openapi-generator-cli ( docker )
OpenAPI declaration file content or url
https://api.sap.com/odata/1.0/catalog.svc/APIContent.APIs('UT_ERP_ISU_UMC_0001')/$value?type=json
Swagger:
https://api.sap.com/api/UT_ERP_ISU_UMC_0001/resource/Accounts
Generation Details
Steps to reproduce
Grab the json and run
docker run --rm -v $PWD:/local openapitools/openapi-generator-cli generate -i /local/openapi.json -g php -o /local/out/php
Related issues/PRs
Suggest a fix
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 declaration and run the Docker PHP generation command to reproduce the invalid $resourcePath output. Inspect the generated PHP handling for paths containing single quotes; done means the generated client contains valid PHP with those path quotes escaped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100