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. */
| 2947 | * "GET", "RequestMapping" → "ANY", JAX-RS "GET" → "GET"). Returns NULL when the |
| 2948 | * annotation is not a route-mapping annotation. */ |
| 2949 | static 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"), |
no outgoing calls
no test coverage detected