desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Bulk add/remove shared parameters/responses

Open ozum opened this issue 6 years ago • 7 comments

Switched to v4 from classic version, I could not find traits. How to use trait in v4.

Regards,

ozum avatar Jun 25 '18 15:06 ozum

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 avatar Jun 25 '18 15:06 ozum

@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.

tbarn avatar Jul 26 '18 15:07 tbarn

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)

ozum avatar Jul 27 '18 11:07 ozum

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.

screen shot 2018-08-02 at 15 20 46

celalo avatar Aug 02 '18 14:08 celalo

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.

lottamus avatar Aug 02 '18 16:08 lottamus

Thanks. Also please consider to add this feature again in the future.

Thanks,

ozum avatar Aug 02 '18 17:08 ozum

@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.

tbarn avatar Aug 02 '18 17:08 tbarn