module Noir::TreeSitterMicronautExtractor

Overview

Tree-sitter-backed Micronaut route + parameter extractor.

Walks @Controller-annotated classes and emits one route per method-level verb annotation. Recognises:

Out of scope for this first cut: meta-annotations, @Filter, @Produces (response type, not input), @RequestAttribute.

Extended Modules

Defined in:

miniparsers/micronaut_extractor_ts.cr

Constant Summary

HTTP_VERB_ANNOTATIONS = {"Get" => "GET", "Post" => "POST", "Put" => "PUT", "Delete" => "DELETE", "Patch" => "PATCH", "Head" => "HEAD", "Options" => "OPTIONS"}
PARAM_ANNOTATION_FORMAT = {"QueryValue" => "query", "Header" => "header", "CookieValue" => "cookie", "Part" => "form"}
PRIMITIVE_TYPES = Set {"boolean", "byte", "char", "short", "int", "long", "float", "double", "void", "string", "object", "integer", "character"}

Instance Method Summary

Instance Method Detail

def extract_controller_interface_implementations(source : String) : Array(ControllerInterfaceImplementation) #

[View source]
def extract_controller_interface_implementations_from(root : LibTreeSitter::TSNode, source : String) : Array(ControllerInterfaceImplementation) #

[View source]
def extract_interface_routes(source : String, dto_index : Hash(String, Array(TreeSitterJavaParameterExtractor::FieldInfo)) = {} of String => Array(TreeSitterJavaParameterExtractor::FieldInfo), *, include_callees : Bool = false) : Hash(String, Array(Route)) #

[View source]
def extract_interface_routes_from(root : LibTreeSitter::TSNode, source : String, dto_index : Hash(String, Array(TreeSitterJavaParameterExtractor::FieldInfo)) = {} of String => Array(TreeSitterJavaParameterExtractor::FieldInfo), *, include_callees : Bool = false) : Hash(String, Array(Route)) #

[View source]
def extract_routes(source : String, dto_index : Hash(String, Array(TreeSitterJavaParameterExtractor::FieldInfo)) = {} of String => Array(TreeSitterJavaParameterExtractor::FieldInfo), *, include_callees : Bool = false) : Array(Route) #

[View source]