Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header parameters not shown in Swagger UI #65

Open
asiirtol opened this issue May 20, 2022 · 2 comments
Open

Header parameters not shown in Swagger UI #65

asiirtol opened this issue May 20, 2022 · 2 comments

Comments

@asiirtol
Copy link

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];

@notorious-PID
Copy link

notorious-PID commented Aug 12, 2022

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

asiirtol added a commit to asiirtol/oatpp-swagger that referenced this issue Nov 22, 2022
@ns-wxin
Copy link

ns-wxin commented May 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants