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

Function oa_controller

internal/cbm/openapi.c:120–131  ·  view source on GitHub ↗

Connexion's controller: on the operation, else its path. */

Source from the content-addressed store, hash-verified

118
119/* Connexion's controller: on the operation, else its path. */
120static const char *oa_controller(const CBMExtractCtx *ctx, TSNode op, TSNode path_item) {
121 static const char *const keys[] = {"x-openapi-router-controller", "x-swagger-router-controller",
122 NULL};
123 for (int k = 0; keys[k]; k++) {
124 const char *c = oa_dup_scalar(ctx, oa_get(ctx, op, keys[k]));
125 c = c ? c : oa_dup_scalar(ctx, oa_get(ctx, path_item, keys[k]));
126 if (c) {
127 return c;
128 }
129 }
130 return NULL;
131}
132
133/* One operation: its Route, and its operationId's reference. */
134static void oa_operation(CBMExtractCtx *ctx, const char *path, const char *method, TSNode op,

Callers 1

oa_operationFunction · 0.85

Calls 2

oa_dup_scalarFunction · 0.85
oa_getFunction · 0.85

Tested by

no test coverage detected