oatpp-swagger icon indicating copy to clipboard operation
oatpp-swagger copied to clipboard

Header parameters not shown in Swagger UI

Open asiirtol opened this issue 3 years ago • 2 comments

Currently, headers parameters are not shown in Swagger UI. The problem is in the line 424 of Generator.cpp: filteredHeaders[header] = info->headers[header]; which uses operator[] instead of add() to insert header parameters. Hence, a possible fix is to change the line to: filteredHeaders.add(header, info->headers[header].type) = info->headers[header];

asiirtol avatar May 20 '22 06:05 asiirtol

The issue still persists, are there plans to resolve it? The fix seems simple enough and describing headers is an important swagger feature.

notorious-PID avatar Aug 12 '22 06:08 notorious-PID

I tried @asiirtol's fix, but the "required" field seems to be ignored when I tried to define an optional header. Now that I have to provide the header otherwise I get an error.

ns-wxin avatar May 20 '24 18:05 ns-wxin