swagger-maven-plugin
swagger-maven-plugin copied to clipboard
Unable to generate correct security block
Unable to obtain correct security description in generated openApi spec :
maven configuration :
<securityDefinitions>
<securityDefinition>
<jsonPath>${basedir}/src/main/resources/secDef.json</jsonPath>
</securityDefinition>
</securityDefinitions>
secDef.json file content :
{
"bearerToken": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
Result obtained :
"securityDefinitions" : {
"bearerToken" : {
"type" : "apiKey",
"name" : "bearerToken",
"in" : "header"
}
}
Result expected :
"securityDefinitions" : {
"bearerToken" : {
"type" : "apiKey",
"name" : "Authorization",
"in" : "header"
}
}
Same here. Did you find any fix @nbeucler?
I had to manually run some sed
s in the pipeline and replace the stuff myself...
Also encountering the same behaviour...
securityDefinitions.json
:
{
"APIKeyHeader": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
}
Output:
"securityDefinitions" : {
"APIKeyHeader" : {
"type" : "apiKey",
"name" : "APIKeyHeader",
"in" : "header"
}
}
Expected output:
"securityDefinitions" : {
"APIKeyHeader" : {
"type" : "apiKey",
"name" : "Authorization",
"in" : "header"
}
}