From dfd2e940b18c8f72bf755bb78bfe77ca82e5347d Mon Sep 17 00:00:00 2001 From: Abhinav Gupta <127770473+abhinav-hasura@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:10:50 -0800 Subject: [PATCH] Make schema field mandatory in ConnectorLink (#315) V3_GIT_ORIGIN_REV_ID: 5d782bc8dec8630b5b63821b61ecec615f0ed47f --- v3/engine/src/metadata/resolved/data_connector.rs | 9 ++++++++- v3/open-dds/metadata.jsonschema | 14 ++------------ v3/open-dds/src/data_connector.rs | 15 ++++++++++++++- v3/open-dds/src/data_connector/v1.rs | 9 ++++++++- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/v3/engine/src/metadata/resolved/data_connector.rs b/v3/engine/src/metadata/resolved/data_connector.rs index e23946398ca..2a4574a69ac 100644 --- a/v3/engine/src/metadata/resolved/data_connector.rs +++ b/v3/engine/src/metadata/resolved/data_connector.rs @@ -267,7 +267,14 @@ mod tests { "url": { "singleUrl": { "value": "http://test.com" } }, "schema": { "version": "v0.1", - "capabilities": { "versions": "1", "capabilities": { "query": {} }} + "capabilities": { "versions": "1", "capabilities": { "query": {} }}, + "schema": { + "scalar_types": {}, + "object_types": {}, + "collections": [], + "functions": [], + "procedures": [] + } } } "#, diff --git a/v3/open-dds/metadata.jsonschema b/v3/open-dds/metadata.jsonschema index 37d98604c9b..2a513d126e0 100644 --- a/v3/open-dds/metadata.jsonschema +++ b/v3/open-dds/metadata.jsonschema @@ -515,6 +515,7 @@ "type": "object", "required": [ "capabilities", + "schema", "version" ], "properties": { @@ -525,18 +526,7 @@ ] }, "schema": { - "default": { - "scalar_types": {}, - "object_types": {}, - "collections": [], - "functions": [], - "procedures": [] - }, - "allOf": [ - { - "$ref": "https://raw.githubusercontent.com/hasura/ndc-spec/v0.1.0-rc.13/ndc-client/tests/json_schema/schema_response.jsonschema" - } - ] + "$ref": "https://raw.githubusercontent.com/hasura/ndc-spec/v0.1.0-rc.13/ndc-client/tests/json_schema/schema_response.jsonschema" }, "capabilities": { "$ref": "https://raw.githubusercontent.com/hasura/ndc-spec/v0.1.0-rc.13/ndc-client/tests/json_schema/capabilities_response.jsonschema" diff --git a/v3/open-dds/src/data_connector.rs b/v3/open-dds/src/data_connector.rs index 472bc872b97..ec376d0077a 100644 --- a/v3/open-dds/src/data_connector.rs +++ b/v3/open-dds/src/data_connector.rs @@ -58,7 +58,6 @@ pub enum VersionedSchemaAndCapabilities { #[schemars(title = "SchemaAndCapabilitiesV01")] pub struct SchemaAndCapabilitiesV01 { #[schemars(schema_with = "ndc_schema_response_v01_schema_reference")] - #[serde(default)] pub schema: SchemaResponse, #[schemars(schema_with = "ndc_capabilities_response_v01_schema_reference")] pub capabilities: CapabilitiesResponse, @@ -94,6 +93,13 @@ mod tests { "capabilities": { "query": {} } + }, + "schema": { + "scalar_types": {}, + "object_types": {}, + "collections": [], + "functions": [], + "procedures": [] } } } @@ -123,6 +129,13 @@ mod tests { "capabilities": { "query": {} } + }, + "schema": { + "scalar_types": {}, + "object_types": {}, + "collections": [], + "functions": [], + "procedures": [] } } } diff --git a/v3/open-dds/src/data_connector/v1.rs b/v3/open-dds/src/data_connector/v1.rs index 071bb5552ea..35794ac77e4 100644 --- a/v3/open-dds/src/data_connector/v1.rs +++ b/v3/open-dds/src/data_connector/v1.rs @@ -62,7 +62,14 @@ impl DataConnectorLinkV1 { "variables": {} } } - } + }, + "schema": { + "scalar_types": {}, + "object_types": {}, + "collections": [], + "functions": [], + "procedures": [] + } } } "#,