Fix: Add schemas property to dataconnect.yaml JSON schema#10774
Fix: Add schemas property to dataconnect.yaml JSON schema#10774fredzqm wants to merge 2 commits into
schemas property to dataconnect.yaml JSON schema#10774Conversation
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request updates the dataconnect-yaml.json schema to support a list of schema configurations via a new schemas array property. The reviewer identified an issue where the referenced #/definitions/schema does not define an id property and has additionalProperties set to false, which will cause validation failures for secondary schemas that require an id. A suggestion was provided to update the schema definition to include the id property.
| "schemas": { | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/schema" | ||
| }, | ||
| "description": "A list of schema configurations." | ||
| } |
There was a problem hiding this comment.
While adding the schemas property is correct, the referenced #/definitions/schema definition does not define the id property (which is used by secondary schemas in the schemas array, as represented by SchemaYaml in src/dataconnect/types.ts).
Because #/definitions/schema has "additionalProperties": false, any schema configuration in the schemas array that specifies an id will fail JSON schema validation in VS Code.
To fix this, please also update #/definitions/schema (around line 47) to include the id property:
"schema": {
"additionalProperties": false,
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the schema configuration."
},
"source": {
"type": "string",
"description": "Relative path to directory containing GQL files defining the schema. If omitted, defaults to ./schema."
},
"datasource": {
"$ref": "#/definitions/dataSource"
}
}
}
This patch updates
schema/dataconnect-yaml.jsonto include theschemasproperty as an array ofschemaitems. This resolves validation issues in VS Code for dataconnect apps that specify an array of schema configurations usingschemas.PR created automatically by Jules for task 4144845718607347064 started by @fredzqm