-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
[FEATURE REQUEST] RAML-like traits #108
Comments
This is exactly how I was imagining it 👍 |
Just updated the description with the proposal. |
This comment from @handrews is something to take into account: OAI/Overlay-Specification#39. |
Updated the description. Changes are:
|
@fmvilas how did you take into account the comment of mine that you linked to? I have not had a chance to catch up on all of these traits proposals, so my apologies if the answer should be obvious. But given the ongoing discussion in OpenAPI for this I am curious as to your reasoning. |
Well, the first of all the measures we took is that we're not allowing traits in schemas, just on the operation and message objects. And to be even more sure that we don't mess things up, only a set of safe/annotations fields are allowed to be "overridden". Plus, it is mandatory the object before and after applying traits MUST be valid. As you can see, the intention is to roll this out slowly and see how it is used. I hope I'm not missing anything from your comment! |
Also, traits are something will be preprocessed before diving into any JSON Schema validation. So it's actually syntax sugar on top of the AsyncAPI document. |
@fmvilas thanks! That makes sense. In the context of the problems I was describing in the referenced issue, even requiring all of the inputs and outputs of the merge to be valid on their own does not eliminate the problem (the example that I give to illustrate the problem actually meets those criteria). But if you are keeping traits out of the schema objects then it should be fine. |
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Is your feature request related to a problem? Please describe.
I want to be able to better reuse parts of an AsyncAPI document. As an example, if all my messages have 4 headers in common, I'd like to be able to group them using a name and express it in each message.
Can't it be tackled using specification extensions?
No.
Describe the solution you'd like
The idea is to implement something similar to what RAML did with traits. Traits are pieces of information that will be merged into the referencing object. Here are some rules:
payload
property. Operation traits MUST NOT contain themessage
property.{{
and}}
.Example
The text was updated successfully, but these errors were encountered: