{
  "openapi": "3.1.0",
  "info": {
    "title": "AHS Rates338 local research API",
    "version": "338.1",
    "description": "Memory-only local service. No public API deployment. EUR, single curve, relative year fractions. Unknown fields rejected by contract; cross-field validations in engine. COM JSON adapter shares this business layer."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:8338"
    }
  ],
  "paths": {
    "/v1/CreateMarket": {
      "post": {
        "operationId": "CreateMarket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "valuation_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "currency": {
                    "enum": [
                      "EUR"
                    ]
                  }
                },
                "required": [
                  "valuation_date",
                  "currency"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/AddCurve": {
      "post": {
        "operationId": "AddCurve",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "curve": {
                    "type": "object",
                    "properties": {
                      "times": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "number",
                          "description": "year fraction from valuation"
                        }
                      },
                      "discount_factors": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "number",
                          "description": "P(0,t)",
                          "exclusiveMinimum": 0
                        }
                      },
                      "interpolation": {
                        "enum": [
                          "log_df",
                          "linear_df",
                          "linear_zero"
                        ]
                      }
                    },
                    "required": [
                      "times",
                      "discount_factors",
                      "interpolation"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "market_id",
                  "curve"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/AddVolatilitySurface": {
      "post": {
        "operationId": "AddVolatilitySurface",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "surface": {
                    "type": "object",
                    "properties": {
                      "expiries": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "number",
                          "description": "years",
                          "exclusiveMinimum": 0
                        }
                      },
                      "tenors": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "number",
                          "description": "years",
                          "exclusiveMinimum": 0
                        }
                      },
                      "values": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "array",
                          "minItems": 1,
                          "items": {
                            "type": "number",
                            "description": "normal absolute rate / sqrt(year)",
                            "minimum": 0
                          }
                        }
                      },
                      "quote_convention": {
                        "enum": [
                          "normal_decimal_sqrt_year"
                        ]
                      }
                    },
                    "required": [
                      "expiries",
                      "tenors",
                      "values",
                      "quote_convention"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "market_id",
                  "surface"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/SetModelParameters": {
      "post": {
        "operationId": "SetModelParameters",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "a": {
                    "type": "number",
                    "description": "1/year",
                    "minimum": 0.001,
                    "maximum": 3
                  },
                  "sigma": {
                    "type": "number",
                    "description": "decimal rate / sqrt(year)",
                    "minimum": 0,
                    "maximum": 0.1
                  }
                },
                "required": [
                  "market_id",
                  "a",
                  "sigma"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/CreateSwap": {
      "post": {
        "operationId": "CreateSwap",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notional": {
                    "type": "number",
                    "description": "EUR",
                    "minimum": 1,
                    "maximum": 10000000000.0
                  },
                  "start": {
                    "type": "number",
                    "description": "years",
                    "minimum": 0,
                    "maximum": 30
                  },
                  "payment_times": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "number",
                      "description": "years",
                      "exclusiveMinimum": 0,
                      "maximum": 30
                    }
                  },
                  "fixed_rate": {
                    "type": "number",
                    "description": "decimal/year",
                    "minimum": -0.2,
                    "maximum": 0.5
                  },
                  "direction": {
                    "enum": [
                      -1,
                      1
                    ]
                  }
                },
                "required": [
                  "notional",
                  "start",
                  "payment_times",
                  "fixed_rate",
                  "direction"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/CreateExerciseSchedule": {
      "post": {
        "operationId": "CreateExerciseSchedule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "times": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "number",
                      "description": "years",
                      "exclusiveMinimum": 0,
                      "maximum": 30
                    }
                  }
                },
                "required": [
                  "times"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/CreateBermudanSwaption": {
      "post": {
        "operationId": "CreateBermudanSwaption",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "swap_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "exercise_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  }
                },
                "required": [
                  "swap_id",
                  "exercise_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/CreateTARN": {
      "post": {
        "operationId": "CreateTARN",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notional": {
                    "type": "number",
                    "description": "EUR",
                    "minimum": 1,
                    "maximum": 10000000000.0
                  },
                  "rates": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "number",
                      "description": "decimal/year",
                      "minimum": -0.5,
                      "maximum": 1
                    }
                  },
                  "target": {
                    "type": "number",
                    "description": "fraction of notional",
                    "exclusiveMinimum": 0,
                    "maximum": 1
                  },
                  "coupon": {
                    "type": "number",
                    "description": "decimal/year",
                    "minimum": -1,
                    "maximum": 1
                  },
                  "gearing": {
                    "type": "number",
                    "description": "dimensionless",
                    "minimum": -20,
                    "maximum": 20
                  },
                  "floor": {
                    "type": "number",
                    "description": "decimal/year",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "accrual": {
                    "type": "number",
                    "description": "years",
                    "minimum": 0.01,
                    "maximum": 1
                  }
                },
                "required": [
                  "notional",
                  "rates",
                  "target",
                  "coupon",
                  "gearing",
                  "floor",
                  "accrual"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/CreatePricer": {
      "post": {
        "operationId": "CreatePricer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "trade_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "steps": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 600
                  }
                },
                "required": [
                  "market_id",
                  "trade_id",
                  "steps"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "kind": {
                          "type": "string",
                          "description": ""
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "engine"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/RunValuation": {
      "post": {
        "operationId": "RunValuation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pricer_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  }
                },
                "required": [
                  "pricer_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "price",
                        "currency",
                        "method",
                        "result_id",
                        "configuration",
                        "market_snapshot",
                        "trade_snapshot",
                        "engine",
                        "backend"
                      ],
                      "properties": {
                        "price": {
                          "type": "number",
                          "description": "EUR"
                        },
                        "currency": {
                          "const": "EUR"
                        },
                        "method": {
                          "type": "string",
                          "description": ""
                        },
                        "result_id": {
                          "type": "string",
                          "description": "Opaque immutable snapshot ID, process-local"
                        },
                        "configuration": {
                          "type": "object"
                        },
                        "market_snapshot": {
                          "type": "object"
                        },
                        "trade_snapshot": {
                          "type": "object"
                        },
                        "engine": {
                          "type": "string",
                          "description": ""
                        },
                        "backend": {
                          "type": "string",
                          "description": ""
                        },
                        "exercise_policy": {
                          "type": "array",
                          "minItems": 1,
                          "items": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "type": "number",
                              "description": ""
                            }
                          }
                        },
                        "curve_fit_max_abs": {
                          "type": "number",
                          "description": ""
                        },
                        "grid": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ComputeSensitivities": {
      "post": {
        "operationId": "ComputeSensitivities",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pricer_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "bump": {
                    "type": "number",
                    "description": "parallel continuous zero-rate shift, decimal",
                    "minimum": 1e-06,
                    "maximum": 0.01
                  }
                },
                "required": [
                  "pricer_id",
                  "bump"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "base": {
                          "type": "number",
                          "description": "EUR"
                        },
                        "up": {
                          "type": "number",
                          "description": "EUR"
                        },
                        "down": {
                          "type": "number",
                          "description": "EUR"
                        },
                        "central_change": {
                          "type": "number",
                          "description": "EUR for specified bump"
                        },
                        "derivative_per_decimal_rate": {
                          "type": "number",
                          "description": "EUR / decimal rate"
                        },
                        "bump_decimal": {
                          "type": "number",
                          "description": ""
                        },
                        "definition": {
                          "type": "string",
                          "description": ""
                        },
                        "unit": {
                          "const": "EUR"
                        }
                      },
                      "required": [
                        "base",
                        "up",
                        "down",
                        "central_change",
                        "derivative_per_decimal_rate",
                        "bump_decimal",
                        "definition",
                        "unit"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/RunScenario": {
      "post": {
        "operationId": "RunScenario",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pricer_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  },
                  "parallel_shift": {
                    "type": "number",
                    "description": "parallel continuous zero-rate shift, decimal",
                    "minimum": -0.1,
                    "maximum": 0.1
                  }
                },
                "required": [
                  "pricer_id",
                  "parallel_shift"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "parallel_shift",
                        "price",
                        "method"
                      ],
                      "properties": {
                        "parallel_shift": {
                          "type": "number",
                          "description": ""
                        },
                        "price": {
                          "type": "number",
                          "description": "EUR"
                        },
                        "method": {
                          "type": "string",
                          "description": ""
                        }
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/GetDiagnostics": {
      "post": {
        "operationId": "GetDiagnostics",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pricer_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  }
                },
                "required": [
                  "pricer_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "curve_fit_max_abs": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "grid_comparison": {
                          "type": "array",
                          "minItems": 1,
                          "items": {
                            "type": "object"
                          }
                        },
                        "validation": {
                          "type": "string",
                          "description": ""
                        },
                        "scope": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "required": [
                        "curve_fit_max_abs",
                        "grid_comparison",
                        "validation",
                        "scope"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ExportResults": {
      "post": {
        "operationId": "ExportResults",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "result_id": {
                    "type": "string",
                    "description": "Opaque immutable snapshot ID, process-local"
                  }
                },
                "required": [
                  "result_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "filename": {
                          "type": "string",
                          "description": ""
                        },
                        "csv": {
                          "type": "string",
                          "description": "RFC4180 CSV, field/value/unit; includes JSON snapshots"
                        }
                      },
                      "required": [
                        "filename",
                        "csv"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown snapshot ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": ""
              },
              "field": {
                "type": "string",
                "description": ""
              },
              "message": {
                "type": "string",
                "description": ""
              }
            },
            "required": [
              "code",
              "field",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ok",
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}