Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Organization for schemas and example JSON payloads #76

Closed
grant opened this issue Sep 29, 2020 · 2 comments · Fixed by #77
Closed

Better Organization for schemas and example JSON payloads #76

grant opened this issue Sep 29, 2020 · 2 comments · Fixed by #77
Assignees
Labels
api: eventarc Issues related to the googleapis/google-cloudevents API.

Comments

@grant
Copy link
Contributor

grant commented Sep 29, 2020

Expected Behavior

  • It would be nice if this repo supported other representations for CloudEvent data like json/jsonschema/avro/etc.
  • It would be nice if the folder name protos was more accurate.

I think it would make sense to change the protos directory to something more generic like schemas (my vote). Or removing that directory making google a top-level folder in this repo (google/ would make sense in google-cloudevents).

Actual Behavior

  • The protos folder has other useful metadata like JSON samples, curl, JSON Schema. It's really nice having these files together.
  • The testdata folder has the same structure, but is far from the source of truth (not in the same folder).

Example: https://github.com/googleapis/google-cloudevents/tree/master/proto/google/events/cloud/pubsub/v1


The downside of changing the folder would be any URLs to this schema as of now and some changes needed in the generators. But I think it would be worth it.


What are your thoughts @jskeet, @michaelawyu @grayside?

@product-auto-label product-auto-label bot added the api: eventarc Issues related to the googleapis/google-cloudevents API. label Sep 29, 2020
@jskeet
Copy link
Collaborator

jskeet commented Sep 29, 2020

Personally I'd prefer to go in the opposite direction. I'd rather have three top level directories:

  • protos
  • jsonschema
  • testdata

(I'm still not personally convinced by having lots of curl scripts - I'd rather have a single README that shows how to make a curl request using one of the data files as the source of request information.)

To me, looking at a directory with multiple types of file - particularly when both JSON schema and the test data as .json files - feels messy. (As a parallel example, it's like having source code from multiple languages in a single directory.) Note that while all the files are together, they have to share a single directory structure, which is basically dictated by protos. With separate top-level directories, each kind of file can use whatever directory structure makes the most sense.

@grant
Copy link
Contributor Author

grant commented Sep 29, 2020

Yeah, I think that approach is better.

We just need to make sure that the folder paths match exactly between those 3 representations and that it's easily discoverable.

That approach would also not break the API (CE-TYPE), which is crucial. Will create a PR.

@grant grant changed the title Consider Changing protos folder to schemas For Accuracy/Flexibility Better Organization for schemas and example JSON payloads Sep 29, 2020
@grant grant closed this as completed in #77 Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: eventarc Issues related to the googleapis/google-cloudevents API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants