rspec-openapi icon indicating copy to clipboard operation
rspec-openapi copied to clipboard

Generate multiple examples

Open AlexeyMatskevich opened this issue 10 months ago • 2 comments

I tried to do the generation of a few examples as described here. I would like to get a review of my approach before I continue working on this feature.

The very design of this feature is also questionable, perhaps it makes sense to use the feature in roughly this way for simpler cases:

describe '#index', openapi: { enable_examples: true } do
    context 'when foo', openapi: { example_name: :foo }
    context 'when bar', openapi: { example_name: :bar }
end

In other cases I am concerned about the definition of unique examples, do I need to remove non-unique examples, or should I keep all examples? Maybe both options are needed for flexibility 🤔

AlexeyMatskevich avatar Apr 12 '24 18:04 AlexeyMatskevich