Skip to content

Commit

Permalink
Make schema field mandatory in ConnectorLink (#315)
Browse files Browse the repository at this point in the history
V3_GIT_ORIGIN_REV_ID: 5d782bc8dec8630b5b63821b61ecec615f0ed47f
  • Loading branch information
abhinav-hasura authored and hasura-bot committed Feb 5, 2024
1 parent 339cc34 commit dfd2e94
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
9 changes: 8 additions & 1 deletion v3/engine/src/metadata/resolved/data_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
}
}
"#,
Expand Down
14 changes: 2 additions & 12 deletions v3/open-dds/metadata.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@
"type": "object",
"required": [
"capabilities",
"schema",
"version"
],
"properties": {
Expand All @@ -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"
Expand Down
15 changes: 14 additions & 1 deletion v3/open-dds/src/data_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -94,6 +93,13 @@ mod tests {
"capabilities": {
"query": {}
}
},
"schema": {
"scalar_types": {},
"object_types": {},
"collections": [],
"functions": [],
"procedures": []
}
}
}
Expand Down Expand Up @@ -123,6 +129,13 @@ mod tests {
"capabilities": {
"query": {}
}
},
"schema": {
"scalar_types": {},
"object_types": {},
"collections": [],
"functions": [],
"procedures": []
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion v3/open-dds/src/data_connector/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ impl DataConnectorLinkV1 {
"variables": {}
}
}
}
},
"schema": {
"scalar_types": {},
"object_types": {},
"collections": [],
"functions": [],
"procedures": []
}
}
}
"#,
Expand Down

0 comments on commit dfd2e94

Please sign in to comment.