Skip to main content

soma_codemode/preamble/
openapi.rs

1pub fn generate_openapi_provider_js() -> &'static str {
2    r#"
3globalThis.openapi = {
4  call: function (label, operationId, params) {
5    if (typeof label !== "string" || typeof operationId !== "string") {
6      throw new Error(JSON.stringify({ kind: "missing_param", message: "openapi.call(label, operationId, params) requires string label and operationId" }));
7    }
8    return callTool("openapi::" + label + "." + operationId, params == null ? {} : params);
9  }
10};
11"#
12}