dox icon indicating copy to clipboard operation
dox copied to clipboard

Content-Type header in request sample section is different than the actual request Content-Type header

Open minazek opened this issue 4 years ago • 0 comments

The Content-Type header in request sample section does not match actual content type in the request: image

The cause of this issue is in the https://github.com/infinum/dox/blob/9734fdfd253901961005871fe040e43dcc4426e1/lib/dox/printers/example_request_printer.rb#L50 because it reads Accept header instead of Content-Type header.

When the line is changed to this:

headers.find { |key, _| key == 'Content-Type' }&.last || 'any'

then the out looks correct: image

minazek avatar Oct 18 '21 12:10 minazek