forked from loafle/openapi-generator-original
OpenAPIClient-php
Echo Server API
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: http_auth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new OpenAPI\Client\Api\AuthApi(
// 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(),
$config
);
try {
$result = $apiInstance->testAuthHttpBasic();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthApi->testAuthHttpBasic: ', $e->getMessage(), PHP_EOL;
}
API Endpoints
All URIs are relative to http://localhost:3000
Class | Method | HTTP request | Description |
---|---|---|---|
AuthApi | testAuthHttpBasic | POST /auth/http/basic | To test HTTP basic authentication |
BodyApi | testBinaryGif | POST /binary/gif | Test binary (gif) response body |
BodyApi | testBodyApplicationOctetstreamBinary | POST /body/application/octetstream/binary | Test body parameter(s) |
BodyApi | testBodyMultipartFormdataArrayOfBinary | POST /body/application/octetstream/array_of_binary | Test array of binary in multipart mime |
BodyApi | testEchoBodyFreeFormObjectResponseString | POST /echo/body/FreeFormObject/response_string | Test free form object |
BodyApi | testEchoBodyPet | POST /echo/body/Pet | Test body parameter(s) |
BodyApi | testEchoBodyPetResponseString | POST /echo/body/Pet/response_string | Test empty response body |
BodyApi | testEchoBodyTagResponseString | POST /echo/body/Tag/response_string | Test empty json (request body) |
FormApi | testFormIntegerBooleanString | POST /form/integer/boolean/string | Test form parameter(s) |
FormApi | testFormOneof | POST /form/oneof | Test form parameter(s) for oneOf schema |
HeaderApi | testHeaderIntegerBooleanString | GET /header/integer/boolean/string | Test header parameter(s) |
PathApi | testsPathStringPathStringIntegerPathInteger | GET /path/string/{path_string}/integer/{path_integer} | Test path parameter(s) |
QueryApi | testEnumRefString | GET /query/enum_ref_string | Test query parameter(s) |
QueryApi | testQueryDatetimeDateString | GET /query/datetime/date/string | Test query parameter(s) |
QueryApi | testQueryIntegerBooleanString | GET /query/integer/boolean/string | Test query parameter(s) |
QueryApi | testQueryStyleDeepObjectExplodeTrueObject | GET /query/style_deepObject/explode_true/object | Test query parameter(s) |
QueryApi | testQueryStyleDeepObjectExplodeTrueObjectAllOf | GET /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
QueryApi | testQueryStyleFormExplodeTrueArrayString | GET /query/style_form/explode_true/array_string | Test query parameter(s) |
QueryApi | testQueryStyleFormExplodeTrueObject | GET /query/style_form/explode_true/object | Test query parameter(s) |
QueryApi | testQueryStyleFormExplodeTrueObjectAllOf | GET /query/style_form/explode_true/object/allOf | Test query parameter(s) |
Models
- Bird
- Category
- DataQuery
- DefaultValue
- NumberPropertiesOnly
- Pet
- Query
- StringEnumRef
- Tag
- TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
Authorization
http_auth
- Type: HTTP basic authentication
Tests
To run the tests, use:
composer install
vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
0.1.0
- Build package:
org.openapitools.codegen.languages.PhpNextgenClientCodegen