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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added operationId to metadata of request specs #131

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

jamerine
Copy link
Contributor

Added a change to allow users to add operationId to the metadata of request specs. There have been requests to make the OpenAPI spec require operationId for many reasons. Here is an example: OAI/OpenAPI-Specification#1907.

If a user adds operation-id to the metadata of a request spec, it will be added to the path section of the schema.

First time contributor and I struggled to figure out where to add a test for this feature. Let me know if there is a place where you would like to see a spec for this.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #131 (42d67cc) into master (6a1fbf4) will increase coverage by 0.26%.
Report is 6 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   96.65%   96.91%   +0.26%     
==========================================
  Files          14       14              
  Lines         419      422       +3     
==========================================
+ Hits          405      409       +4     
+ Misses         14       13       -1     
Files Coverage Δ
lib/rspec/openapi/record.rb 100.00% <ø> (ø)
lib/rspec/openapi/record_builder.rb 100.00% <100.00%> (+1.53%) ⬆️
lib/rspec/openapi/schema_builder.rb 97.87% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jamerine
Copy link
Contributor Author

@exoego - What are your thoughts on this feature to enable operationId to be passed in as metadata options on a spec?

lib/rspec/openapi.rb Fixed Show fixed Hide fixed
lib/rspec/openapi/result_recorder.rb Fixed Show fixed Hide fixed
lib/rspec/openapi/result_recorder.rb Fixed Show fixed Hide fixed
lib/rspec/openapi/result_recorder.rb Fixed Show fixed Hide fixed
lib/rspec/openapi/result_recorder.rb Fixed Show fixed Hide fixed
lib/rspec/openapi/rspec_hooks.rb Fixed Show fixed Hide fixed
@exoego
Copy link
Owner

exoego commented Sep 28, 2023

Supporting operation-id itself sounds legit to me.
It is unclear to me that path_server_records or other props are added.

@jamerine
Copy link
Contributor Author

Supporting operation-id itself sounds legit to me. It is unclear to me that path_server_records or other props are added.

@exoego - Sorry for the confusion here, I was testing out another proposed feature to the gem and committed my change to this PR. I am going to revert my last commit here so that this PR is strictly for the operation-id feature. Then I'll submit another PR for the server record changes.

@jamerine
Copy link
Contributor Author

@exoego - Ok, this PR for adding operation-id is good to review again.

Copy link
Owner

@exoego exoego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamerine Could you update any single test to use :operation_id so we can ensure OpenAPI file generated by tests have operationId.

@jamerine
Copy link
Contributor Author

jamerine commented Oct 4, 2023

@exoego - We added :operation_id to a test and updated the expected.yaml to have the operationId as well. Let me know if there are any other changes you would like us to make.

@jamerine
Copy link
Contributor Author

jamerine commented Oct 9, 2023

@exoego - If we can get this :operation_id PR merged in, I will open up another PR for another proposed new feature.

@exoego
Copy link
Owner

exoego commented Oct 10, 2023

Sorry for the late response.
Thanks.

@exoego exoego merged commit 48d556d into exoego:master Oct 10, 2023
14 checks passed
@exoego exoego added the enhancement New feature or request label Oct 10, 2023
@jamerine jamerine deleted the feat-add-operation-id-support branch October 10, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants