Skip to content

Commit

Permalink
fix: patch postgen.js to add examples field back (#130)
Browse files Browse the repository at this point in the history
* fix: patch postgen.js to add examples field back

* Minor fix

* Minor fix

* Minor fix

Co-authored-by: Grant Timmerman <744973+grant@users.noreply.github.com>
  • Loading branch information
chenyumic and grant authored Jan 13, 2021
1 parent 14ae399 commit 801315a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion jsonschema/google/events/cloud/audit/v1/LogEntryData.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/audit/v1/LogEntryData.json",
"name": "LogEntryData",
"examples": [],
"examples": [
"https://googleapis.github.io/google-cloudevents/testdata/google/events/cloud/audit/v1/LogEntryData-pubsubCreateTopic.json"
],
"package": "google.events.cloud.audit.v1",
"datatype": "google.events.cloud.audit.v1.LogEntryData",
"cloudeventTypes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/firestore/v1/DocumentEventData.json",
"name": "DocumentEventData",
"examples": [],
"examples": [
"https://googleapis.github.io/google-cloudevents/testdata/google/events/cloud/firestore/v1/DocumentEventData-complex.json",
"https://googleapis.github.io/google-cloudevents/testdata/google/events/cloud/firestore/v1/DocumentEventData-simple.json"
],
"package": "google.events.cloud.firestore.v1",
"datatype": "google.events.cloud.firestore.v1.DocumentEventData",
"cloudeventTypes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/pubsub/v1/MessagePublishedData.json",
"name": "MessagePublishedData",
"examples": [],
"examples": [
"https://googleapis.github.io/google-cloudevents/testdata/google/events/cloud/pubsub/v1/MessagePublishedData-binary.json",
"https://googleapis.github.io/google-cloudevents/testdata/google/events/cloud/pubsub/v1/MessagePublishedData-text.json"
],
"package": "google.events.cloud.pubsub.v1",
"datatype": "google.events.cloud.pubsub.v1.MessagePublishedData",
"cloudeventTypes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$id": "https://googleapis.github.io/google-cloudevents/jsonschema/google/events/cloud/storage/v1/StorageObjectData.json",
"name": "StorageObjectData",
"examples": [],
"examples": [
"https://googleapis.github.io/google-cloudevents/testdata/google/events/cloud/storage/v1/StorageObjectData-simple.json"
],
"package": "google.events.cloud.storage.v1",
"datatype": "google.events.cloud.storage.v1.StorageObjectData",
"cloudeventTypes": [
Expand Down
2 changes: 1 addition & 1 deletion tools/proto2jsonschema/postgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function getExamples(filepath) {
const isJSONFile = value.isFile() && value.name.endsWith('.json');
return isJSONFile ? `https://googleapis.github.io/google-cloudevents/testdata/${removeSuffix}/${value.name}` : null;
})
.filter((value) => !value);
.filter((value) => value != null);
}

/**
Expand Down

0 comments on commit 801315a

Please sign in to comment.