MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / annotation_route_method

Function annotation_route_method

internal/cbm/extract_defs.c:2949–2978  ·  view source on GitHub ↗

HTTP method for a Spring/JAX-RS style annotation name (e.g. "GetMapping" → * "GET", "RequestMapping" → "ANY", JAX-RS "GET" → "GET"). Returns NULL when the * annotation is not a route-mapping annotation. */

Source from the content-addressed store, hash-verified

2947 * "GET", "RequestMapping" → "ANY", JAX-RS "GET" → "GET"). Returns NULL when the
2948 * annotation is not a route-mapping annotation. */
2949static const char *annotation_route_method(const char *name) {
2950 if (!name) {
2951 return NULL;
2952 }
2953 if (strcmp(name, "GetMapping") == 0) {
2954 return "GET";
2955 }
2956 if (strcmp(name, "PostMapping") == 0) {
2957 return "POST";
2958 }
2959 if (strcmp(name, "PutMapping") == 0) {
2960 return "PUT";
2961 }
2962 if (strcmp(name, "DeleteMapping") == 0) {
2963 return "DELETE";
2964 }
2965 if (strcmp(name, "PatchMapping") == 0) {
2966 return "PATCH";
2967 }
2968 if (strcmp(name, "RequestMapping") == 0) {
2969 return "ANY";
2970 }
2971 /* JAX-RS bare-verb annotations (@GET/@POST/...) — path comes from @Path. */
2972 if (strcmp(name, "GET") == 0 || strcmp(name, "POST") == 0 || strcmp(name, "PUT") == 0 ||
2973 strcmp(name, "DELETE") == 0 || strcmp(name, "PATCH") == 0 || strcmp(name, "HEAD") == 0 ||
2974 strcmp(name, "OPTIONS") == 0) {
2975 return name;
2976 }
2977 return NULL;
2978}
2979
2980/* Extract route path + method from a decorator's AST nodes.
2981 * Works for: @app.route("/path"), @router.post("/path"), @GetMapping("/path"),

Callers 2

scan_route_annotationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected