Module: DiscoveryV1
- Defined in:
- lib/discovery_v1.rb,
lib/discovery_v1/version.rb,
lib/discovery_v1/validation.rb,
lib/discovery_v1/validation/load_schemas.rb,
lib/discovery_v1/validation/validate_object.rb,
lib/discovery_v1/validation/resolve_schema_ref.rb,
lib/discovery_v1/validation/traverse_object_tree.rb
Overview
Unofficial helpers for the Google Discovery V1 API
Defined Under Namespace
Modules: Validation
Constant Summary collapse
- VERSION =
The version of this gem
'0.2.3'
Validation collapse
-
.object_schema_names(rest_description:, logger: Logger.new(nil)) ⇒ Array<String>
List the names of the schemas available to use in the Google Discovery V1 API.
-
.validate_object(rest_description:, schema_name:, object:, logger: Logger.new(nil))
Validate the object using the named JSON schema.
Class Method Summary collapse
-
.discovery_service ⇒ Google::Apis::DiscoveryV1::DiscoveryService
Create a new Google::Apis::DiscoveryV1::DiscoveryService object.
Class Method Details
.discovery_service ⇒ Google::Apis::DiscoveryV1::DiscoveryService
Create a new Google::Apis::DiscoveryV1::DiscoveryService object
A credential is not needed to use the DiscoveryService.
23 24 25 |
# File 'lib/discovery_v1.rb', line 23 def discovery_service Google::Apis::DiscoveryV1::DiscoveryService.new end |
.object_schema_names(rest_description:, logger: Logger.new(nil)) ⇒ Array<String>
List the names of the schemas available to use in the Google Discovery V1 API
63 64 65 |
# File 'lib/discovery_v1.rb', line 63 def object_schema_names(rest_description:, logger: Logger.new(nil)) DiscoveryV1::Validation::LoadSchemas.new(rest_description:, logger:).call.keys.sort end |
.validate_object(rest_description:, schema_name:, object:, logger: Logger.new(nil))
This method returns an undefined value.
Validate the object using the named JSON schema
The JSON schemas are loaded from the Google Disocvery API. The schemas names are
returned by DiscoveryV1.api_object_schema_names
.
48 49 50 |
# File 'lib/discovery_v1.rb', line 48 def validate_object(rest_description:, schema_name:, object:, logger: Logger.new(nil)) DiscoveryV1::Validation::ValidateObject.new(rest_description:, logger:).call(schema_name:, object:) end |