-
Notifications
You must be signed in to change notification settings - Fork 23
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
Split the subject object into subject and predicate #51
Comments
We should expand on the motive and benefits so we can decide when to implement this. |
The |
This change helps with human readability. |
I think the change improves the human readability and would help clear up the documentation. The change would be a large amount of work and would need to be coordinated with the SDKs. |
We can include this in hacktoberfest as a possible set of tasks. |
Talked about this in today's SIG, while I agree it may improve some readability, I dont think it will be that tremendous of an improvement. The subject.changed nesting is only one level deep. The data structure for subject is quite simple. If the subject was much complicated I would tend to agree this improves readability. And with that said, it's important to note that machines do not care about the structure of the JSON, and given that it is still pretty readable, I'd be okay closing this. |
Closing for now. |
I propose that the subject object within each event type definition is split into two objects - subject and predicate, where the new subject object would contain items that are identical for all event types on the same subject, and the predicate contains the attributes that are different for events with different predicates but same subject.
At the same time the "content" object could be collapsed I believe.
I think this provides a clearer structure of the event. A drawback with this approach is that it might sometimes be hard to determine whether a field is to be placed in the predicate object or the subject object. One such example is the
url
in the example below. It could be argued that it is the same for both predicates defined ("started" and "finished"), but I'd say it could be different since the "finished" event could link to an archived edition of the taskRun execution while the "started" event would link to an ongoing execution.Example for the dev.cdevents.taskrun.finished event, that should be changed from:
to:
The text was updated successfully, but these errors were encountered: