{
  "openapi": "3.1.0",
  "info": {
    "title": "Fixture Loom self-hosted API",
    "version": "0.2.0"
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/v1/inspect": {
      "post": {
        "operationId": "inspect",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "har": {
                    "type": "string",
                    "maxLength": 10485760
                  }
                },
                "required": [
                  "har"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bounded JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 999
                          },
                          "method": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "status": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "method",
                          "url",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "entries"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Stable error code"
          }
        }
      }
    },
    "/v1/validate-policy": {
      "post": {
        "operationId": "validate_policy",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "policy": {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "number",
                        "const": 1
                      },
                      "selected": {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 999
                        }
                      },
                      "origins": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "maxLength": 4096
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 4096
                        }
                      },
                      "volatileQuery": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 256
                        }
                      },
                      "resolutions": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "exact"
                                },
                                "entry": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 999
                                }
                              },
                              "required": [
                                "entries",
                                "mode",
                                "entry"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "ordered"
                                }
                              },
                              "required": [
                                "entries",
                                "mode"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "edits": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "entry": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 999
                            },
                            "body": {
                              "type": "string",
                              "maxLength": 5242880
                            }
                          },
                          "required": [
                            "entry",
                            "body"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "selected",
                      "origins",
                      "volatileQuery",
                      "resolutions",
                      "edits"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "policy"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bounded JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "policy": {
                      "type": "object",
                      "properties": {
                        "schemaVersion": {
                          "type": "number",
                          "const": 1
                        },
                        "selected": {
                          "minItems": 1,
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 999
                          }
                        },
                        "origins": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "maxLength": 4096
                          },
                          "additionalProperties": {
                            "type": "string",
                            "maxLength": 4096
                          }
                        },
                        "volatileQuery": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "maxLength": 256
                          }
                        },
                        "resolutions": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "entries": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 999
                                    }
                                  },
                                  "mode": {
                                    "type": "string",
                                    "const": "exact"
                                  },
                                  "entry": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "required": [
                                  "entries",
                                  "mode",
                                  "entry"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "entries": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 999
                                    }
                                  },
                                  "mode": {
                                    "type": "string",
                                    "const": "ordered"
                                  }
                                },
                                "required": [
                                  "entries",
                                  "mode"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "edits": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "entry": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 999
                              },
                              "body": {
                                "type": "string",
                                "maxLength": 5242880
                              }
                            },
                            "required": [
                              "entry",
                              "body"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "schemaVersion",
                        "selected",
                        "origins",
                        "volatileQuery",
                        "resolutions",
                        "edits"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "policy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Stable error code"
          }
        }
      }
    },
    "/v1/preview": {
      "post": {
        "operationId": "preview",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "har": {
                    "type": "string",
                    "maxLength": 10485760
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "number",
                        "const": 1
                      },
                      "selected": {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 999
                        }
                      },
                      "origins": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "maxLength": 4096
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 4096
                        }
                      },
                      "volatileQuery": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 256
                        }
                      },
                      "resolutions": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "exact"
                                },
                                "entry": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 999
                                }
                              },
                              "required": [
                                "entries",
                                "mode",
                                "entry"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "ordered"
                                }
                              },
                              "required": [
                                "entries",
                                "mode"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "edits": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "entry": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 999
                            },
                            "body": {
                              "type": "string",
                              "maxLength": 5242880
                            }
                          },
                          "required": [
                            "entry",
                            "body"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "selected",
                      "origins",
                      "volatileQuery",
                      "resolutions",
                      "edits"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "har",
                  "policy"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bounded JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "number",
                      "const": 1
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signature": {
                            "type": "string"
                          },
                          "entries": {
                            "type": "array",
                            "items": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 999
                            }
                          },
                          "classification": {
                            "type": "string",
                            "enum": [
                              "unique",
                              "duplicate-identical",
                              "ambiguous"
                            ]
                          },
                          "resolved": {
                            "type": "boolean"
                          },
                          "mode": {
                            "type": "string",
                            "enum": [
                              "exact",
                              "ordered"
                            ]
                          },
                          "chosen": {
                            "type": "array",
                            "items": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 999
                            }
                          }
                        },
                        "required": [
                          "signature",
                          "entries",
                          "classification",
                          "resolved",
                          "mode",
                          "chosen"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "schemaVersion",
                    "routes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Stable error code"
          }
        }
      }
    },
    "/v1/build": {
      "post": {
        "operationId": "build",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "har": {
                    "type": "string",
                    "maxLength": 10485760
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "number",
                        "const": 1
                      },
                      "selected": {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 999
                        }
                      },
                      "origins": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "maxLength": 4096
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 4096
                        }
                      },
                      "volatileQuery": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 256
                        }
                      },
                      "resolutions": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "exact"
                                },
                                "entry": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 999
                                }
                              },
                              "required": [
                                "entries",
                                "mode",
                                "entry"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "ordered"
                                }
                              },
                              "required": [
                                "entries",
                                "mode"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "edits": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "entry": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 999
                            },
                            "body": {
                              "type": "string",
                              "maxLength": 5242880
                            }
                          },
                          "required": [
                            "entry",
                            "body"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "selected",
                      "origins",
                      "volatileQuery",
                      "resolutions",
                      "edits"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "har",
                  "policy"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bounded JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "bytes": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "characters": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "name",
                          "bytes",
                          "characters"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "manifest": {
                      "type": "object",
                      "properties": {
                        "schemaVersion": {
                          "type": "number",
                          "const": 1
                        },
                        "engine": {
                          "type": "string"
                        },
                        "policy": {
                          "type": "object",
                          "properties": {
                            "schemaVersion": {
                              "type": "number",
                              "const": 1
                            },
                            "selected": {
                              "minItems": 1,
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 999
                              }
                            },
                            "origins": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 4096
                              },
                              "additionalProperties": {
                                "type": "string",
                                "maxLength": 4096
                              }
                            },
                            "volatileQuery": {
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "maxLength": 256
                              }
                            },
                            "resolutions": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "entries": {
                                        "maxItems": 1000,
                                        "type": "array",
                                        "items": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 999
                                        }
                                      },
                                      "mode": {
                                        "type": "string",
                                        "const": "exact"
                                      },
                                      "entry": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 999
                                      }
                                    },
                                    "required": [
                                      "entries",
                                      "mode",
                                      "entry"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "entries": {
                                        "maxItems": 1000,
                                        "type": "array",
                                        "items": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 999
                                        }
                                      },
                                      "mode": {
                                        "type": "string",
                                        "const": "ordered"
                                      }
                                    },
                                    "required": [
                                      "entries",
                                      "mode"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "edits": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entry": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  },
                                  "body": {
                                    "type": "string",
                                    "maxLength": 5242880
                                  }
                                },
                                "required": [
                                  "entry",
                                  "body"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "schemaVersion",
                            "selected",
                            "origins",
                            "volatileQuery",
                            "resolutions",
                            "edits"
                          ],
                          "additionalProperties": false
                        },
                        "routes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "signature": {
                                "type": "string"
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "exact",
                                  "ordered"
                                ]
                              },
                              "responses": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "file": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "status",
                                    "file"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "signature",
                              "mode",
                              "responses"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "hashes": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "schemaVersion",
                        "engine",
                        "policy",
                        "routes",
                        "hashes"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "files",
                    "manifest"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Stable error code"
          }
        }
      }
    },
    "/v1/export": {
      "post": {
        "operationId": "export",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "har": {
                    "type": "string",
                    "maxLength": 10485760
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "number",
                        "const": 1
                      },
                      "selected": {
                        "minItems": 1,
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 999
                        }
                      },
                      "origins": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "maxLength": 4096
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 4096
                        }
                      },
                      "volatileQuery": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 256
                        }
                      },
                      "resolutions": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "exact"
                                },
                                "entry": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 999
                                }
                              },
                              "required": [
                                "entries",
                                "mode",
                                "entry"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "entries": {
                                  "maxItems": 1000,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 999
                                  }
                                },
                                "mode": {
                                  "type": "string",
                                  "const": "ordered"
                                }
                              },
                              "required": [
                                "entries",
                                "mode"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "edits": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "entry": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 999
                            },
                            "body": {
                              "type": "string",
                              "maxLength": 5242880
                            }
                          },
                          "required": [
                            "entry",
                            "body"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "selected",
                      "origins",
                      "volatileQuery",
                      "resolutions",
                      "edits"
                    ],
                    "additionalProperties": false
                  },
                  "file": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "offset": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "limit": {
                    "default": 16384,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16384
                  }
                },
                "required": [
                  "har",
                  "policy",
                  "file",
                  "offset",
                  "limit"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bounded JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "file": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "nextOffset": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "file",
                    "text",
                    "nextOffset"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Stable error code"
          }
        }
      }
    }
  }
}