rspec-openapi
rspec-openapi copied to clipboard
Evaluate proc for RSpec::OpenAPI.title
My use case is generating different openapi files from different RSpec request files. The RSpec::OpenAPI.path
proc is great to export YAML to different files, but I was surprised to see I couldn't do the same with RSpec::OpenAPI.title
Unfortunately the following snippet generates: title: !ruby/object:Proc {}
RSpec::OpenAPI.title = -> (example) {
return "Customer API" if example.file_path == "./spec/requests/customer_api_spec.rb"
return "Reseller API" if example.file_path == "./spec/requests/resellers_api_spec.rb"
"API"
}
How about https://github.com/exoego/rspec-openapi/pull/162
Ah interesting. My usecase is slightly different. I would favour a proc on RSpec::OpenAPI.title
in a single config file rather than creating the multiple config files.