(schemaStore)
- createSchemaStoreItem - Create a schema in the schema store
- getSchemaStoreItem - Get a OAS schema from the schema store
Create a schema in the schema store
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\CreateSchemaStoreItemRequestBody(
format: Operations\Format::Yaml,
packageName: '<value>',
sdkClassname: '<value>',
spec: '<value>',
);
$response = $sdk->schemaStore->createSchemaStoreItem(
request: $request
);
if ($response->schemaStoreItem !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\CreateSchemaStoreItemRequestBody | ✔️ | The request object to use for the request. |
?Operations\CreateSchemaStoreItemResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKExceptioon | 5XX | */* |
Get a OAS schema from the schema store
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetSchemaStoreItemRequestBody();
$response = $sdk->schemaStore->getSchemaStoreItem(
request: $request
);
if ($response->schemaStoreItem !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetSchemaStoreItemRequestBody | ✔️ | The request object to use for the request. |
?Operations\GetSchemaStoreItemResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKExceptioon | 5XX | */* |