joffrey-bion / livedoc

A not-so-annotation-based documentation generator for REST and websocket services
MIT License
5 stars 2 forks source link

Negated spring header support #37

Closed joffrey-bion closed 6 years ago

joffrey-bion commented 7 years ago

Header filters in @RequestMapping can also be negated using the notations "!header-name" and "header!=value". From the Spring documentation:

Expressions can be negated by using the "!=" operator, as in "My-Header!=myValue". "My-Header" style expressions are also supported, with such headers having to be present in the request (allowed to have any value). Finally, "!My-Header" style expressions indicate that the specified header is not supposed to be present in the request.

Also supports media type wildcards (*), for headers such as Accept and Content-Type. For instance:

@RequestMapping(value = "/something", headers = "content-type=text/*")

will match requests with a Content-Type of "text/html", "text/plain", etc.