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

Conversation

asiirtol
Copy link

Fix issue #65

@@ -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?

@ns-wxin
Copy link

ns-wxin commented May 20, 2024

@asiirtol and @lganzzzo , do you plan to support header annotation in any release coming out soon? If we don't have a perfect solution yet, would this fix be good enough?

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

Successfully merging this pull request may close these issues.

3 participants