Julian Vennen 6bd3d53eee
[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
2024-11-09 16:50:12 +08:00

15 KiB

OpenAPI\Client\BodyApi

All URIs are relative to http://localhost:3000, except if the operation defines another base path.

Method HTTP request Description
testBinaryGif() POST /binary/gif Test binary (gif) response body
testBodyApplicationOctetstreamBinary() POST /body/application/octetstream/binary Test body parameter(s)
testBodyMultipartFormdataArrayOfBinary() POST /body/application/octetstream/array_of_binary Test array of binary in multipart mime
testBodyMultipartFormdataSingleBinary() POST /body/application/octetstream/single_binary Test single binary in multipart mime
testEchoBodyAllOfPet() POST /echo/body/allOf/Pet Test body parameter(s)
testEchoBodyFreeFormObjectResponseString() POST /echo/body/FreeFormObject/response_string Test free form object
testEchoBodyPet() POST /echo/body/Pet Test body parameter(s)
testEchoBodyPetResponseString() POST /echo/body/Pet/response_string Test empty response body
testEchoBodyStringEnum() POST /echo/body/string_enum Test string enum response body
testEchoBodyTagResponseString() POST /echo/body/Tag/response_string Test empty json (request body)

testBinaryGif()

testBinaryGif(): \SplFileObject

Test binary (gif) response body

Test binary (gif) response body

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);

try {
    $result = $apiInstance->testBinaryGif();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testBinaryGif: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\SplFileObject

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: image/gif

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testBodyApplicationOctetstreamBinary()

testBodyApplicationOctetstreamBinary($body): string

Test body parameter(s)

Test body parameter(s)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = '/path/to/file.txt'; // \SplFileObject

try {
    $result = $apiInstance->testBodyApplicationOctetstreamBinary($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testBodyApplicationOctetstreamBinary: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
body \SplFileObject**\SplFileObject** [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testBodyMultipartFormdataArrayOfBinary()

testBodyMultipartFormdataArrayOfBinary($files): string

Test array of binary in multipart mime

Test array of binary in multipart mime

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$files = array('/path/to/file.txt'); // \SplFileObject[]

try {
    $result = $apiInstance->testBodyMultipartFormdataArrayOfBinary($files);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testBodyMultipartFormdataArrayOfBinary: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
files \SplFileObject[]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testBodyMultipartFormdataSingleBinary()

testBodyMultipartFormdataSingleBinary($my_file): string

Test single binary in multipart mime

Test single binary in multipart mime

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$my_file = '/path/to/file.txt'; // \SplFileObject

try {
    $result = $apiInstance->testBodyMultipartFormdataSingleBinary($my_file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testBodyMultipartFormdataSingleBinary: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
my_file \SplFileObject**\SplFileObject** [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testEchoBodyAllOfPet()

testEchoBodyAllOfPet($pet): \OpenAPI\Client\Model\Pet

Test body parameter(s)

Test body parameter(s)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store

try {
    $result = $apiInstance->testEchoBodyAllOfPet($pet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testEchoBodyAllOfPet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
pet \OpenAPI\Client\Model\Pet Pet object that needs to be added to the store [optional]

Return type

\OpenAPI\Client\Model\Pet

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testEchoBodyFreeFormObjectResponseString()

testEchoBodyFreeFormObjectResponseString($body): string

Test free form object

Test free form object

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = array('key' => new \stdClass); // object | Free form object

try {
    $result = $apiInstance->testEchoBodyFreeFormObjectResponseString($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testEchoBodyFreeFormObjectResponseString: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
body object Free form object [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testEchoBodyPet()

testEchoBodyPet($pet): \OpenAPI\Client\Model\Pet

Test body parameter(s)

Test body parameter(s)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store

try {
    $result = $apiInstance->testEchoBodyPet($pet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testEchoBodyPet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
pet \OpenAPI\Client\Model\Pet Pet object that needs to be added to the store [optional]

Return type

\OpenAPI\Client\Model\Pet

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testEchoBodyPetResponseString()

testEchoBodyPetResponseString($pet): string

Test empty response body

Test empty response body

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store

try {
    $result = $apiInstance->testEchoBodyPetResponseString($pet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testEchoBodyPetResponseString: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
pet \OpenAPI\Client\Model\Pet Pet object that needs to be added to the store [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testEchoBodyStringEnum()

testEchoBodyStringEnum($body): \OpenAPI\Client\Model\StringEnumRef

Test string enum response body

Test string enum response body

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = 'body_example'; // string | String enum

try {
    $result = $apiInstance->testEchoBodyStringEnum($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testEchoBodyStringEnum: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
body string String enum [optional]

Return type

\OpenAPI\Client\Model\StringEnumRef

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testEchoBodyTagResponseString()

testEchoBodyTagResponseString($tag): string

Test empty json (request body)

Test empty json (request body)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\BodyApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$tag = new \OpenAPI\Client\Model\Tag(); // \OpenAPI\Client\Model\Tag | Tag object

try {
    $result = $apiInstance->testEchoBodyTagResponseString($tag);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BodyApi->testEchoBodyTagResponseString: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
tag \OpenAPI\Client\Model\Tag Tag object [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]