Skip to content

Commit

Permalink
feat: Update JSON Schemas to Use Definitions for all Properties (#289)
Browse files Browse the repository at this point in the history
* chore!: update json schemas

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* feat: simplify jsonschemas

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* fix: add schema definition to catalog

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* ci: reset lockfiles

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
  • Loading branch information
grant authored Oct 15, 2021
1 parent 74b1820 commit 9d1bcda
Show file tree
Hide file tree
Showing 14 changed files with 1,692 additions and 1,673 deletions.
1,007 changes: 429 additions & 578 deletions jsonschema/google/events/cloud/audit/v1/LogEntryData.json

Large diffs are not rendered by default.

796 changes: 422 additions & 374 deletions jsonschema/google/events/cloud/cloudbuild/v1/BuildEventData.json

Large diffs are not rendered by default.

133 changes: 77 additions & 56 deletions jsonschema/google/events/cloud/firestore/v1/DocumentEventData.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,44 @@
],
"product": "Cloud Firestore",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"value": {
"$ref": "#/definitions/Document",
"additionalProperties": true,
"description": "A Document object containing a post-operation document snapshot.\n This is not populated for delete events."
},
"oldValue": {
"$ref": "#/definitions/Document",
"$ref": "#/definitions/DocumentEventData",
"definitions": {
"DocumentEventData": {
"properties": {
"value": {
"$ref": "#/definitions/Document",
"additionalProperties": true,
"description": "A Document object containing a post-operation document snapshot.\n This is not populated for delete events."
},
"oldValue": {
"$ref": "#/definitions/Document",
"additionalProperties": true,
"description": "A Document object containing a pre-operation document snapshot.\n This is only populated for update and delete events."
},
"updateMask": {
"$ref": "#/definitions/DocumentMask",
"additionalProperties": true,
"description": "A DocumentMask object that lists changed fields.\n This is only populated for update events."
}
},
"additionalProperties": true,
"description": "A Document object containing a pre-operation document snapshot.\n This is only populated for update and delete events."
"type": "object",
"description": "The data within all Firestore document events."
},
"updateMask": {
"ArrayValue": {
"properties": {
"fieldPaths": {
"values": {
"items": {
"type": "string"
"$ref": "#/definitions/Value"
},
"type": "array",
"description": "The list of field paths in the mask.\n See [Document.fields][google.cloud.firestore.v1.events.Document.fields]\n for a field path syntax reference."
"description": "Values in the array."
}
},
"additionalProperties": true,
"type": "object",
"description": "A DocumentMask object that lists changed fields.\n This is only populated for update events."
}
},
"additionalProperties": true,
"type": "object",
"description": "The data within all Firestore document events.",
"definitions": {
"description": "An array value."
},
"Document": {
"properties": {
"name": {
Expand Down Expand Up @@ -72,8 +80,36 @@
},
"additionalProperties": true,
"type": "object",
"description": "A Firestore document.",
"id": "google.events.cloud.firestore.v1.Document"
"description": "A Firestore document."
},
"DocumentMask": {
"properties": {
"fieldPaths": {
"items": {
"type": "string"
},
"type": "array",
"description": "The list of field paths in the mask.\n See [Document.fields][google.cloud.firestore.v1.events.Document.fields]\n for a field path syntax reference."
}
},
"additionalProperties": true,
"type": "object",
"description": "A set of field paths on a document."
},
"MapValue": {
"properties": {
"fields": {
"additionalProperties": {
"$ref": "#/definitions/Value",
"additionalProperties": true
},
"type": "object",
"description": "The map's fields.\n\n The map keys represent field names. Field names matching the regular\n expression `__.*__` are reserved. Reserved field names are forbidden except\n in certain documented contexts. The map keys, represented as UTF-8, must\n not exceed 1,500 bytes and cannot be empty."
}
},
"additionalProperties": true,
"type": "object",
"description": "A map value."
},
"Value": {
"properties": {
Expand Down Expand Up @@ -124,54 +160,39 @@
"description": "A reference to a document. For example:\n `projects/{project_id}/databases/{database_id}/documents/{document_path}`."
},
"geoPointValue": {
"properties": {
"latitude": {
"type": "number",
"description": "The latitude in degrees. It must be in the range [-90.0, +90.0]."
},
"longitude": {
"type": "number",
"description": "The longitude in degrees. It must be in the range [-180.0, +180.0]."
}
},
"$ref": "#/definitions/LatLng",
"additionalProperties": true,
"type": "object",
"description": "A geo point value representing a point on the surface of Earth."
},
"arrayValue": {
"properties": {
"values": {
"items": {
"$ref": "#/definitions/Value"
},
"type": "array",
"description": "Values in the array."
}
},
"$ref": "#/definitions/ArrayValue",
"additionalProperties": true,
"type": "object",
"description": "An array value.\n\n Cannot directly contain another array value, though can contain an\n map which contains another array."
},
"mapValue": {
"properties": {
"fields": {
"additionalProperties": {
"$ref": "#/definitions/Value",
"additionalProperties": true
},
"type": "object",
"description": "The map's fields.\n\n The map keys represent field names. Field names matching the regular\n expression `__.*__` are reserved. Reserved field names are forbidden except\n in certain documented contexts. The map keys, represented as UTF-8, must\n not exceed 1,500 bytes and cannot be empty."
}
},
"$ref": "#/definitions/MapValue",
"additionalProperties": true,
"type": "object",
"description": "A map value."
}
},
"additionalProperties": true,
"type": "object",
"description": "A message that can hold any of the supported value types.",
"id": "google.events.cloud.firestore.v1.Value"
"description": "A message that can hold any of the supported value types."
},
"LatLng": {
"properties": {
"latitude": {
"type": "number",
"description": "The latitude in degrees. It must be in the range [-90.0, +90.0]."
},
"longitude": {
"type": "number",
"description": "The longitude in degrees. It must be in the range [-180.0, +180.0]."
}
},
"additionalProperties": true,
"type": "object",
"description": "An object representing a latitude/longitude pair. This is expressed as a pair\n of doubles representing degrees latitude and degrees longitude. Unless\n specified otherwise, this must conform to the\n <a href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\">WGS84\n standard</a>. Values must be within normalized ranges."
}
}
}
32 changes: 21 additions & 11 deletions jsonschema/google/events/cloud/pubsub/v1/MessagePublishedData.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,25 @@
],
"product": "Cloud Pub/Sub",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"message": {
"$ref": "#/definitions/MessagePublishedData",
"definitions": {
"MessagePublishedData": {
"properties": {
"message": {
"$ref": "#/definitions/PubsubMessage",
"additionalProperties": true,
"description": "The message that was published."
},
"subscription": {
"type": "string",
"description": "The resource name of the subscription for which this event was\n generated. The format of the value is\n `projects/{project-id}/subscriptions/{subscription-id}`."
}
},
"additionalProperties": true,
"type": "object",
"description": "The event data when a message is published to a topic."
},
"PubsubMessage": {
"properties": {
"data": {
"type": "string",
Expand Down Expand Up @@ -44,14 +61,7 @@
},
"additionalProperties": true,
"type": "object",
"description": "The message that was published."
},
"subscription": {
"type": "string",
"description": "The resource name of the subscription for which this event was\n generated. The format of the value is\n `projects/{project-id}/subscriptions/{subscription-id}`."
"description": "A message published to a topic."
}
},
"additionalProperties": true,
"type": "object",
"description": "The event data when a message is published to a topic."
}
}
25 changes: 15 additions & 10 deletions jsonschema/google/events/cloud/scheduler/v1/SchedulerJobData.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@
],
"product": "Cloud Scheduler",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"customData": {
"type": "string",
"description": "The custom data the user specified when creating the scheduler source.",
"format": "binary",
"binaryEncoding": "base64"
"$ref": "#/definitions/SchedulerJobData",
"definitions": {
"SchedulerJobData": {
"properties": {
"customData": {
"type": "string",
"description": "The custom data the user specified when creating the scheduler source.",
"format": "binary",
"binaryEncoding": "base64"
}
},
"additionalProperties": true,
"type": "object",
"description": "Scheduler job data."
}
},
"additionalProperties": true,
"type": "object",
"description": "Scheduler job data."
}
}
Loading

0 comments on commit 9d1bcda

Please sign in to comment.