REST APIs for managing Schema entities
- get_latest - Get information about the latest schema.
- post - Register a schema.
- download - Download the latest schema for a particular apiID.
- get_diff - Get a diff of two schema revisions for an Api.
- delete - Delete a particular schema revision for an Api.
- get_revision - Get information about a particular schema revision for an Api.
- download_revision - Download a particular schema revision for an Api.
- get - Get information about all schemas associated with a particular apiID.
Returns information about the last uploaded schema for a particular API version. This won't include the schema itself, that can be retrieved via the downloadSchema operation.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.get_latest(api_id="<id>", version_id="<id>")
if ! res.schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to get the schema for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
T.nilable(::OpenApiSDK::Operations::GetSchemaResponse)
Allows uploading a schema for a particular API version. This will be used to populate ApiEndpoints and used as a base for any schema generation if present.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.post(api_id="<id>", version_id="<id>", request_body=::OpenApiSDK::Operations::RegisterSchemaRequestBody.new(
file: ::OpenApiSDK::Operations::File.new(
file_name: "example.file",
content: "0x9fcD0d6727".encode(),
),
))
if res.status_code == 200
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to get the schema for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
request_body |
::OpenApiSDK::Operations::RegisterSchemaRequestBody | ✔️ | The schema file to upload provided as a multipart/form-data file segment. |
T.nilable(::OpenApiSDK::Operations::RegisterSchemaResponse)
Download the latest schema for a particular apiID.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.download(api_id="<id>", version_id="<id>")
if ! res.two_xx_application_json_schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to download the schema for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
T.nilable(::OpenApiSDK::Operations::DownloadSchemaResponse)
Get a diff of two schema revisions for an Api.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.get_diff(api_id="<id>", version_id="<id>", base_revision_id="<id>", target_revision_id="<id>")
if ! res.schema_diff.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to retrieve schemas for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
base_revision_id |
::String | ✔️ | The base revision ID of the schema to retrieve. |
target_revision_id |
::String | ✔️ | The target revision ID of the schema to retrieve. |
T.nilable(::OpenApiSDK::Operations::GetSchemaDiffResponse)
Delete a particular schema revision for an Api.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.delete(api_id="<id>", version_id="<id>", revision_id="<id>")
if res.status_code == 200
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to delete schemas for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
revision_id |
::String | ✔️ | The revision ID of the schema to delete. |
T.nilable(::OpenApiSDK::Operations::DeleteSchemaResponse)
Returns information about the last uploaded schema for a particular schema revision. This won't include the schema itself, that can be retrieved via the downloadSchema operation.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.get_revision(api_id="<id>", version_id="<id>", revision_id="<id>")
if ! res.schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to retrieve schemas for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
revision_id |
::String | ✔️ | The revision ID of the schema to retrieve. |
T.nilable(::OpenApiSDK::Operations::GetSchemaRevisionResponse)
Download a particular schema revision for an Api.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.download_revision(api_id="<id>", version_id="<id>", revision_id="<id>")
if ! res.two_xx_application_json_schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to retrieve schemas for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |
revision_id |
::String | ✔️ | The revision ID of the schema to retrieve. |
T.nilable(::OpenApiSDK::Operations::DownloadSchemaRevisionResponse)
Returns information the schemas associated with a particular apiID. This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.schemas.get(api_id="<id>", version_id="<id>")
if ! res.schemata.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to retrieve schemas for. |
version_id |
::String | ✔️ | The version ID of the Api to delete metadata for. |