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

[3.0.0] Required fields in Operation Trait Object. #856

Closed
magicmatatjahu opened this issue Oct 20, 2022 · 2 comments
Closed

[3.0.0] Required fields in Operation Trait Object. #856

magicmatatjahu opened this issue Oct 20, 2022 · 2 comments
Labels
❔ Question A question about the spec or processes

Comments

@magicmatatjahu
Copy link
Member

I'm wondering if fields like channel and action in the Operation Trait Object should be there or not. These fields in the trait are optional, but in the normal Operation Object are required. I have a problem with this from a validation point of view - since the mentioned fields in the Operation Object are required then they must be defined, that is, first we would have to check if the traits are written correctly, then perform traits merging and then perform Operation Object validation. In the case of the tool ecosystem in JS, this should not be problematic, but the logic will be more complex. For other programming languages, I am afraid that implementing the above logic will be problematic.

I think we should remove the channel and action fields from the Operation Trait. We also need to take into account how traits merging works. If we define a channel in the Operation Object and in one of the traits also we will define some channel field, these channels will be merged as objects - here again there is a problem because we would have to operate on an unresolved version of the document during validation.

cc @fmvilas

@smoya
Copy link
Member

smoya commented Oct 27, 2022

I agree those fields should not be in Operation Trait object. We already removed those from the Parser-API as well few weeks ago for the same reason: https://github.com/asyncapi/parser-api/pull/71/files#diff-ac35ac6e0b0ad3629802a0e04076aa18e94da614f5392e1164dcaacdfe3ee198L241-R292

@magicmatatjahu
Copy link
Member Author

Resolved by #860.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔ Question A question about the spec or processes
Projects
None yet
Development

No branches or pull requests

3 participants