1

The swagger 2 GUI Response Headers view does not seem to display the received headers in the order they appear on thw wire, but instead in a random order.

I have a number of headers (added by jersey) of the form X-Jersey-Tracing-00x, these appear on the wire in sequence

curl -v gives me the headers in the correct order.

Is this a know bug ?

Jan-Olav Eide
  • 403
  • 1
  • 6
  • 17

1 Answers1

1

There is no defined order for HTTP Response headers, except for the status line (which should always be first). So the term 'correct order' is inapplicable to headers in this particular case. I guess that since Swagger first puts the header lines in a JS object, does a little bit of processing and only then lists them, the ordering might be different than cURL's.

If I had to guess, I'd say they won't make Swagger compatible to cURL's output, as the order is not important in the first place.

Community
  • 1
  • 1
MrMister
  • 2,456
  • 21
  • 31
  • Well, the order is important when debugging. I was a bit unclear, I know ordering is not defined, but lexiographic order in the UI would be useful. I now get this, which is hard to read. { "x-jersey-tracing-014": INVOKE... "x-jersey-tracing-007": REQ-FILTER... "x-jersey-tracing-001": "PRE-MATCH... } – Jan-Olav Eide Apr 06 '17 at 12:41