desktop
desktop copied to clipboard
Bulk add/remove shared parameters/responses
Switched to v4 from classic version, I could not find traits. How to use trait in v4.
Regards,
I found that traits is not available in v4 as seen in doc
Is there a future plan to add traits? They were much practical than current method.
@ozum what's the use case that you want to use them with?
Technically traits aren't valid OAS, but it was something we did in Classic through extensions.
I want to use traits where inheritence (like allof etc.) is not supported in official OAS i.e in responses. I assume traits are a feature of editor and not of OAS specification. (It can be embedded directly during code generation)
Traits were a brilliant part of Stoplight Classic. I feel sad, you've been chopping off so many nice features. Please look at the example below. You can easily add this trait to several endpoints and manage it from a single trait.
A Trait is basically just a group of shared parameters/responses that you can edit in the same view and add via one key. When you create a trait, under the hood it should just create some shared parameters/responses. When you add a trait to an operation, under the hood it should just create references to those shared parameters/responses.
I think the solution in the Next is to make it easier to bulk add/remove shared parameters/responses from operations. It currently takes about 5 clicks to add a single shared parameter to an operation.
Thanks. Also please consider to add this feature again in the future.
Thanks,
@ozum we'll definitely keep it in mind! With Stoplight Next, we really wanted to stick closer to the specification on the modeling side but make it faster and easier to model with a specification. allOf
for example is supported in OAS 3, which we are working on full support for.