2

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?

Phate
  • 6,066
  • 15
  • 73
  • 138

1 Answers1

1

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}}
Phate
  • 6,066
  • 15
  • 73
  • 138
  • Thank you for your suggestion. In my case, I created a script that modified my OpenAPI spec (by excluding certain request parameters). And then I proceed normally with openapi generator. – user2991036 Jun 22 '20 at 14:53