Skip to content

Commit

Permalink
feat: make json schema definition stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
benfdking committed May 23, 2024
1 parent a9ce531 commit ee5441a
Show file tree
Hide file tree
Showing 129 changed files with 782 additions and 672 deletions.
2 changes: 2 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ plugins:
out: proto/gen/rust/src
- out: proto/gen/json_schema
plugin: buf.build/community/chrusty-jsonschema
opt:
- disallow_additional_properties
- plugin: buf.build/bufbuild/connect-es
out: proto/gen/es
opt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"column_test": {
"$ref": "#/definitions/quary.service.v1.ColumnTest",
"additionalProperties": true
"additionalProperties": false
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Add Column Test To Model Or Source Column Request"
},
Expand All @@ -34,7 +34,7 @@
"type": "object"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Column Test"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$ref": "#/definitions/AddColumnTestToModelOrSourceColumnResponse",
"definitions": {
"AddColumnTestToModelOrSourceColumnResponse": {
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Add Column Test To Model Or Source Column Response"
}
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/AddColumnToModelOrSourceRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Add Column To Model Or Source Request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$ref": "#/definitions/AddColumnToModelOrSourceResponse",
"definitions": {
"AddColumnToModelOrSourceResponse": {
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Add Column To Model Or Source Response"
}
Expand Down
6 changes: 3 additions & 3 deletions proto/gen/json_schema/BigQueryDataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dataset_reference": {
"$ref": "#/definitions/quary.service.v1.BigQueryDatasetReference",
"additionalProperties": true,
"additionalProperties": false,
"description": "The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID."
},
"friendly_name": {
Expand All @@ -33,7 +33,7 @@
"description": "The geographic location where the dataset resides."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Dataset",
"description": "Dataset API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/list"
Expand All @@ -47,7 +47,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Dataset Reference",
"description": "Dataset Reference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#DatasetReference"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryDatasetReference.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Dataset Reference",
"description": "Dataset Reference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#DatasetReference"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryError.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"description": "A human-readable description of the error."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Error",
"description": "BigQueryError API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/ErrorProto"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryFieldValue.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"description": "Represents the 'v' in a JSON object"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Field Value"
}
Expand Down
10 changes: 5 additions & 5 deletions proto/gen/json_schema/BigQueryJob.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
},
"job_reference": {
"$ref": "#/definitions/quary.service.v1.BigQueryJobReference",
"additionalProperties": true,
"additionalProperties": false,
"description": "A reference uniquely identifying the job."
},
"status": {
"$ref": "#/definitions/quary.service.v1.BigQueryJobStatus",
"additionalProperties": true,
"additionalProperties": false,
"description": "Information about the job, including starting time and ending time of the job."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job",
"description": "Job API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/Job"
Expand All @@ -51,7 +51,7 @@
"description": "The geographic location of the job."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job Reference",
"description": "JobReference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference"
Expand All @@ -71,7 +71,7 @@
"description": "The final error result of the job as a human-readable string."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job Status",
"description": "JobStatus API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/JobStatus"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryJobReference.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"description": "The geographic location of the job."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job Reference",
"description": "JobReference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference"
Expand Down
23 changes: 14 additions & 9 deletions proto/gen/json_schema/BigQueryJobResults.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"schema": {
"$ref": "#/definitions/quary.service.v1.BigQueryTableSchema",
"additionalProperties": true,
"additionalProperties": false,
"description": "The schema of the results. Present only when the query completes successfully."
},
"job_reference": {
"$ref": "#/definitions/quary.service.v1.BigQueryJobReference",
"additionalProperties": true,
"additionalProperties": false,
"description": "A reference uniquely identifying the job."
},
"total_rows": {
Expand All @@ -30,6 +30,7 @@
"items": {
"$ref": "#/definitions/quary.service.v1.BigQueryTableRow"
},
"additionalProperties": false,
"type": "array",
"description": "An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above."
},
Expand All @@ -41,6 +42,7 @@
"items": {
"$ref": "#/definitions/quary.service.v1.BigQueryError"
},
"additionalProperties": false,
"type": "array",
"description": "The first errors encountered during the running of the job. The final message includes the number of errors encountered."
},
Expand All @@ -53,7 +55,7 @@
"description": "The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job Results",
"description": "BigQueryJobResults API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/getQueryResults"
Expand All @@ -77,7 +79,7 @@
"description": "A human-readable description of the error."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Error",
"description": "BigQueryError API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/ErrorProto"
Expand All @@ -93,7 +95,7 @@
"description": "Represents the 'v' in a JSON object"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Field Value"
},
Expand All @@ -112,7 +114,7 @@
"description": "The geographic location of the job."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job Reference",
"description": "JobReference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference"
Expand All @@ -135,6 +137,7 @@
"items": {
"$ref": "#/definitions/quary.service.v1.BigQueryTableField"
},
"additionalProperties": false,
"type": "array",
"description": "Describes the nested schema fields if the type property is set to RECORD."
},
Expand All @@ -143,7 +146,7 @@
"description": "The field description."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table Field",
"description": "Table Field API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableFieldSchema"
Expand All @@ -154,11 +157,12 @@
"items": {
"$ref": "#/definitions/quary.service.v1.BigQueryFieldValue"
},
"additionalProperties": false,
"type": "array",
"description": "Represents a single row as a series of field-value pairs"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table Row"
},
Expand All @@ -174,6 +178,7 @@
"items": {
"$ref": "#/definitions/quary.service.v1.BigQueryTableField"
},
"additionalProperties": false,
"type": "array",
"description": "Describes the fields in a table."
},
Expand All @@ -182,7 +187,7 @@
"description": "The field description."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table Schema",
"description": "Table Schema API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableSchema"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryJobStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"description": "The final error result of the job as a human-readable string."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Job Status",
"description": "JobStatus API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/JobStatus"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryOauthToken.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"description": "absolute time the token expires"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Oauth Token",
"description": "Google Oauth 2.0 token API Documentation: https://developers.google.com/identity/protocols/oauth2/web-server#httprest"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryOauthTokenRefresh.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"description": "absolute time the token expires"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Oauth Token Refresh"
}
Expand Down
6 changes: 3 additions & 3 deletions proto/gen/json_schema/BigQueryProject.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
},
"project_reference": {
"$ref": "#/definitions/quary.service.v1.BigQueryProjectReference",
"additionalProperties": true,
"additionalProperties": false,
"description": "A unique reference to a project."
},
"friendly_name": {
"type": "string",
"description": "A descriptive name for this project."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Project",
"description": "Project API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/projects/list"
Expand All @@ -37,7 +37,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "------------------\n BigQuery Responses\n ------------------",
"description": "------------------ BigQuery Responses ------------------"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryProjectReference.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "------------------\n BigQuery Responses\n ------------------",
"description": "------------------ BigQuery Responses ------------------"
Expand Down
6 changes: 3 additions & 3 deletions proto/gen/json_schema/BigQueryTable.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"table_reference": {
"$ref": "#/definitions/quary.service.v1.BigQueryTableReference",
"additionalProperties": true,
"additionalProperties": false,
"description": "A reference uniquely identifying the table."
},
"type": {
Expand All @@ -26,7 +26,7 @@
"description": "The time when this table was created, in milliseconds since the epoch."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table",
"description": "Table API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/list"
Expand All @@ -43,7 +43,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table Reference",
"description": "Table Reference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableReference"
Expand Down
3 changes: 2 additions & 1 deletion proto/gen/json_schema/BigQueryTableField.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"items": {
"$ref": "#/definitions/BigQueryTableField"
},
"additionalProperties": false,
"type": "array",
"description": "Describes the nested schema fields if the type property is set to RECORD."
},
Expand All @@ -28,7 +29,7 @@
"description": "The field description."
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table Field",
"description": "Table Field API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableFieldSchema"
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/json_schema/BigQueryTableReference.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "string"
}
},
"additionalProperties": true,
"additionalProperties": false,
"type": "object",
"title": "Big Query Table Reference",
"description": "Table Reference API Documentation: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableReference"
Expand Down
Loading

0 comments on commit ee5441a

Please sign in to comment.