Noir::CamelRouteExtractor
Apache Camel HTTP entry points, from the three route-definition
languages Camel reads: the Java DSL (RouteBuilder#configure), the XML
DSL and the YAML DSL. Two shapes, in each language:
- REST DSL:
rest("/users").get("/{id}").post()...— paths are relative torestConfiguration().contextPath(...), which the caller applies (it is CamelContext-wide, so usually in another file). - HTTP consumers:
from("platform-http:/x"),from("jetty:http://h/x"),from("servlet:/x"), ... and the REST componentfrom("rest:get:/x").
No file I/O; one FileResult per source.
Constants
CONSUMER_URI = /\A(platform-http|servlet|jetty|netty-http|undertow|rest):(.*)\z/
JAVA_DSL = "org.apache.camel"
Content gates for route files, shared by the detector and the analyzer.
METHOD_RESTRICT = /(?:\A|&)httpMethodRestrict=([^&]*)/
PARAM_TYPES = {"path" => "path", "query" => "query", "header" => "header", "body" => "json", "formData" => "form"}
Camel RestParamType -> noir param type.
URI_HOST = /\Ahttps?:\/\/[^\/]*/
VERBS = Set {"get", "post", "put", "patch", "delete", "head"}
XML_DSL = /camel\.apache\.org\/schema|<camel[\s>]/
YAML_CONTEXT_KEY = Set {"restConfiguration", "rest-configuration"}
YAML_DSL = /^-[ \t]+(?:rest|route|from|restConfiguration|rest-configuration):/m
/m: in Crystal, ^ matches only at the start of the string without it.
Instance methods
Endpoints of one consumer URI. Non-HTTP components yield none.
Upper-cased raw when it names a real HTTP method; the generic
verb(...) / <verb method> / rest: forms take any string.