phoenixnap / springmvc-raml-plugin

Spring MVC - RAML Spec Synchroniser Plugin. A Maven plugin designed to Generate Server & Client code in Spring from a RAML API descriptor and conversely, a RAML API document from the SpringMVC Server implementation.
Apache License 2.0
136 stars 84 forks source link

Skip headers in method parameters when using injectHttpHeadersParameter #254

Closed techpavan closed 5 years ago

techpavan commented 6 years ago

It might remove a lot of clutter in the method signature if there is an option to skip adding individual headers as method parameters when headers object is added in the parameter.

stojsavljevic commented 5 years ago

Hi, Why would you want to exclude a header as method parameter? If you want to ignore it - why do you define it?

techpavan commented 5 years ago

Its not like ignoring, but the same value is provided twice as method parameters, one as individual param and other as a part of headers. When too many headers are defined, the method length would be too high which might not look good.

stojsavljevic commented 5 years ago

Implementing list of ignored headers would be cumbersome. IMHO, it would make more sense to add flag to skip all individual headers as method arguments. What do you think?

techpavan commented 5 years ago

That's right. And that's what I actually meant, not sure if my choice of words gave a different meaning.

stojsavljevic commented 5 years ago

It might be a better option to automatically skip all individual headers when injectHttpHeadersParameter is in use since they can be accessed from header object. What do you think?

techpavan commented 5 years ago

That would work well. There is no need of headers individually when all headers are available.