Closed flueders closed 3 years ago
@langecode Can you or someone else help me here? Thanks in advance!
Yeah there is agre PRs and issues laying around. I hope to find some time to look at this during the Christmas holidays. I cannot remember if we did implement support for this but otherwise there are other ways to add the security parts to the output.
man. 21. dec. 2020 kl. 16.18 skrev Fabian Lüders notifications@github.com:
@langecode https://github.com/langecode Can you or someone else help me here? Thanks in advance!
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/openapi-tools/swagger-maven-plugin/issues/71#issuecomment-749026140, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPWOQ6IIX72WAGDVDQTI3SV5RLLANCNFSM4U7OHGQQ .
You might take a look at the example in the unittests: https://github.com/openapi-tools/swagger-maven-plugin/blob/master/src/test/resources/generate-mojo-full-pom.xml#L60
This should explain how to add the areas :-)
Thank you very much! This helped to solve my problem.
Just for the record, this is how it is done:
<securityRequirements>
<authorization>
<entries>
<entry>
<name>authorization</name>
</entry>
</entries>
</authorization>
</securityRequirements>
Describe the bug I want to add A SecurityRequirement to my Open API docs.
After interpreting https://github.com/openapi-tools/swagger-maven-plugin/blob/master/src/main/java/io/openapitools/swagger/config/SwaggerSecurityRequirement.java , this is what I did:
This produces the following error:
However, if I remove the
<name>
tags from inside the<entries>
, the maven-plugin does not throw any error. But looking at the generated file, this is what was generated:Expected behavior The expected result would be :
Note: the
securitySchemes
tag is being created correctly. But to enable the schemes globally, the additionalsecurity
tag is needed.So this seems to be a bug while parsing the configuration. Or is there just a mistake in my configuration?