[PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582) (#19529)

* [PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582)

* Move escapeTextInSingleQuotes method to DefaultCodegen, add docblock
This commit is contained in:
Julian Vennen
2024-11-09 09:50:12 +01:00
committed by GitHub
parent 1bda458882
commit 6bd3d53eee
22 changed files with 105 additions and 67 deletions

View File

@@ -92,7 +92,7 @@ $apiInstance = new OpenAPI\Client\Api\BodyApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$body = "/path/to/file.txt"; // \SplFileObject
$body = '/path/to/file.txt'; // \SplFileObject
try {
$result = $apiInstance->testBodyApplicationOctetstreamBinary($body);
@@ -148,7 +148,7 @@ $apiInstance = new OpenAPI\Client\Api\BodyApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$files = array("/path/to/file.txt"); // \SplFileObject[]
$files = array('/path/to/file.txt'); // \SplFileObject[]
try {
$result = $apiInstance->testBodyMultipartFormdataArrayOfBinary($files);
@@ -204,7 +204,7 @@ $apiInstance = new OpenAPI\Client\Api\BodyApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$my_file = "/path/to/file.txt"; // \SplFileObject
$my_file = '/path/to/file.txt'; // \SplFileObject
try {
$result = $apiInstance->testBodyMultipartFormdataSingleBinary($my_file);

View File

@@ -97,8 +97,8 @@ $apiInstance = new OpenAPI\Client\Api\QueryApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$datetime_query = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime
$date_query = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime
$datetime_query = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$date_query = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$string_query = 'string_query_example'; // string
try {