Sending dynamic custom headers in swagger UI try outs

前端 未结 1 702
花落未央
花落未央 2021-02-08 17:20

I am using swagger in java.

I am reading a header called callerId through requestAttributes in the code. I am not using the header through the annotation @HeaderParam.

1条回答
  •  深忆病人
    2021-02-08 17:42

    You can add parameters to an operation using @ApiImplicitParams and @ApiImplicitParam.

    The following wiki documentation should provide you with an explanation on how to use these annotations - https://github.com/swagger-api/swagger-core/wiki/Annotations#apiimplicitparam-apiimplicitparams

    Keep in mind I assume here that this is not a security header but actually part of the API (at least based on the description you gave). If you're looking for a security header, there's an alternative method. Please leave a comment and I'll edit this response.

    0 讨论(0)
提交回复
热议问题