class
Analyzer::CSharp::AspNetCoreMvc
- Analyzer::CSharp::AspNetCoreMvc
- Analyzer
- Reference
- Object
Included Modules
Defined in:
analyzer/analyzers/csharp/aspnet_core_mvc.crConstant Summary
-
DEFAULT_ROUTE =
"{controller=Home}/{action=Index}/{id?}" -
FROM_ATTRIBUTE_PATTERNS =
{"FromQuery" => "query", "FromRoute" => "path", "FromBody" => "json", "FromHeader" => "header", "FromForm" => "form", "FromCookie" => "cookie", "FromServices" => "service", "FromKeyedServices" => "service"}.map do |attr, type| {"[#{attr}", /\[#{attr}[^\]]*\]/, type} end -
Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile). The
[FromX]attribute set is fixed, so precompile its markers and strippers once at load time; the param-name regex interpolates a discovered name and is memoized. -
VERB_ATTRIBUTES =
{"[HttpPost" => {"POST", "HttpPost"}, "[HttpGet" => {"GET", "HttpGet"}, "[HttpPut" => {"PUT", "HttpPut"}, "[HttpDelete" => {"DELETE", "HttpDelete"}, "[HttpPatch" => {"PATCH", "HttpPatch"}, "[HttpHead" => {"HEAD", "HttpHead"}, "[HttpOptions" => {"OPTIONS", "HttpOptions"}} -
Attribute name carrying each verb, for
extract_attribute_route.