Ignore certain headers
I'd like to be able to ignore certain or all headers from being integrated into the generated code.
I handle these headers in Angular via interceptors so having them in the generated code is useless/annoying and keeps me from using the generator.
I was having this problem and as a temporary fix am using jq to preprocess the openapi spec and remove the header before generating, like this:
curl "$OPENAPI_URL" | jq 'del(.. | select(.name? == "x-sender"))' > ./.openapi.yml
We're currently facing the same issue. We address our tenants via a global configuration setting the header and this is redundant. I still like to keep my openapi true to the spec - marking it required.
This is also something I think is missing from the options, See https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/spring.md its an option there...
We have a custom resolver so don't find any value in updating the call sites every time the parameter changes.
Additionally our header name changes based on application configuration which can be set at runtime and thus we need to not have the header name hardcoded in the generated code.