Open
Description
I noticed a strange issue when trying to debug a problem in our documentation. Within the generated curl request, one of our headers is showing up as 'X-Api-Partner' instead of the correct 'X-Api-Partner-Id'.
I traced the problem back to rspec_api_documentation/lib/rspec_api_documentation/curl.rb:68. The format_header
method is using titleize
to capitalize the header name. Titleize unfortunately strips out '_id' suffixes, because it calls humanize
. rails/rails#26011
Could you update the format_header
method to use something other than titleize
? I was thinking something like this would work:
header.gsub(/^HTTP_/, '').split(/ |\_|\-/).map(&:capitalize).join('-')
Thank you.
Metadata
Metadata
Assignees
Labels
No labels