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

Show header parameters in Swagger UI #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/oatpp-swagger/Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void Generator::generatePathItemData(const std::shared_ptr<Endpoint>& endpoint,
for (const auto &header : info->headers.getOrder()) {
// We don't want the Authorization header listed as Parameter. This should be done in ENDPOINT_INFO() { info->addSecurityRequirement( /* SecurityScheme-Name */ ); }
if (header != oatpp::web::protocol::http::Header::AUTHORIZATION) {
filteredHeaders[header] = info->headers[header];
filteredHeaders.add(header, info->headers[header].type) = info->headers[header];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @asiirtol ,

I believe that it's better to fix it here:

The [] operator should check - if it's a new element - then add to m_order

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that modifying operator[] would be a more elegant solution but operator[] only takes a name as a parameter. In order to add a new element it should know the type of the element, too. How operator[] could do that?

}
}
}
Expand Down