Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate multiple examples #210

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexeyMatskevich
Copy link
Contributor

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 AlexeyMatskevich marked this pull request as draft April 12, 2024 18:13
@@ -0,0 +1,21 @@
# frozen_string_literal: true

class SharedExtractor

Check notice

Code scanning / Rubocop

Document classes and non-namespace modules. Note

Style/Documentation: Missing top-level documentation comment for class SharedExtractor.
@AlexeyMatskevich
Copy link
Contributor Author

@exoego take a look, please

@exoego
Copy link
Owner

exoego commented Apr 24, 2024

I am fine with the example_name approach.

How does this handle when some test cases have example_name but other cases don't for an endpoint?

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 馃

I don't get the concern.
When do users specify same example_name to multiple test cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants