-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Reuse headers and attributes? #259
Comments
Putting the headers from |
@winniehell The
But you can not combine it with other parts in a payload. PS: Currently, you cannot reuse headers. |
@pksunkara: yep, looks duplicate to me - I don't know why I didn't find that issue. Thank you for the hint! 👍 |
Sure, I don't mind. 🐠 My primary intention was to find out how to reuse headers and attributes. That problem seems so be solved by Traits as far as I understand it: ## Fast [/fast]
+ Trait Fast
+ Request Headers
X-Fast-Processing: true
## Things [/things]
+ Trait Thing
+ Properties
+ name (string)
### Get Things [GET]
+ Request
+ Traits
+ [Fast][]
+ Response 200 (application/json)
+ Traits
+ [Things][]
### Put Things [PUT]
+ Request (application/json)
+ Traits
+ [Fast][]
+ [Things][]
+ Response 200
Everything fine. Or do I get something wrong? |
@winniehell Well, the traits was still in proposal stage and is currently in an uncertain state since we now have MSON. So, please keep a look out on further updates. |
@winniehell @pksunkara I plan to update and close the traits issue during the course of the next week. To the original question, reusable headers using MSON syntax are definitely planned. |
RFC proposal of syntax addressing this issue: apiaryio/api-blueprint-rfcs#3. Please track and comment on the RFC. Thank you! |
I have a model which defines headers and a model which defines attributes:
Now I want to use the headers in GET- and PUT-request and the attributes in GET-response and PUT-request. The following does not work:
Is there any way to achieve this?
The text was updated successfully, but these errors were encountered: