spring-bootswaggeropenapiopenapi-generator

Openapi generator: is it possible to exclude some headers from auto generated code parameters?


I want to support some "infrastructural" headers and use them to describe my api but, in the generation phase, I don't want those headers to show up as parameters in the code. I will take care of them by using specific means such as interceptors.

Is this possible?


Solution

  • In the end I had to write a custom mustache template and define a vendor extension of mine. Here's the snippet that could help:

                {{#vendorExtensions.x-custom}}
                ,@ApiImplicitParam(name = "param", value = "First param", required=false, dataType = "Integer", paramType = "header")
            {{/vendorExtensions.x-custom}}