{
  "openapi": "3.0.4",
  "info": {
    "title": "Verso.Server | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://verso.service.nexuslib.xyz/"
    }
  ],
  "paths": {
    "/api/v1/search": {
      "post": {
        "tags": [
          "Verso.Server"
        ],
        "operationId": "Search",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "enum": [
                      null
                    ],
                    "nullable": true
                  },
                  {
                    "$ref": "#/components/schemas/SearchRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/record/{id}": {
      "get": {
        "tags": [
          "Verso.Server"
        ],
        "operationId": "GetRecord",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BibRecord"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/v1/suggest": {
      "get": {
        "tags": [
          "Verso.Server"
        ],
        "operationId": "Suggest",
        "parameters": [
          {
            "name": "Q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Field",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string"
                }
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuggestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "tags": [
          "Verso.Server"
        ],
        "operationId": "Health",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health/ready": {
      "get": {
        "tags": [
          "Verso.Server"
        ],
        "operationId": "HealthReady",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BibRecord": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "enum": [
                  null
                ],
                "nullable": true
              }
            ],
            "format": "double",
            "nullable": true
          },
          "highlights": {
            "type": "object",
            "nullable": true
          },
          "bibId": {
            "type": "string",
            "nullable": true
          },
          "titleRaw": {
            "type": "string",
            "nullable": true
          },
          "authorRaw": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "enum": [
                  null
                ],
                "nullable": true
              }
            ],
            "format": "int32",
            "nullable": true
          },
          "isbnClean": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "publication": {
            "type": "string",
            "nullable": true
          },
          "medium": {
            "type": "string",
            "nullable": true
          },
          "recordType": {
            "type": "string",
            "nullable": true
          },
          "bibType": {
            "type": "string",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "nullable": true
          },
          "callNumber": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "titleSort": {
            "type": "string",
            "nullable": true
          },
          "isbn": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "title": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "otherTitle": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "author": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "edition": {
            "type": "string",
            "nullable": true
          },
          "extent": {
            "type": "string",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "series": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "notes": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "abstract": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "subject": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "genre": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "url": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/ListOfstring"
              }
            ]
          },
          "fullText": {
            "type": "string",
            "nullable": true
          },
          "sourceRecord": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "FacetItem": {
        "required": [
          "value",
          "count"
        ],
        "type": "object",
        "properties": {
          "value": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int32"
          }
        }
      },
      "HealthResponse": {
        "required": [
          "status",
          "online"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "online": {
            "type": "boolean"
          }
        }
      },
      "HttpValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "enum": [
                  null
                ],
                "nullable": true
              }
            ],
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "JsonElement": { },
      "ListOfstring": { },
      "ReadinessResponse": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "SearchRangeFilter": {
        "type": "object",
        "properties": {
          "min": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "enum": [
                  null
                ],
                "nullable": true
              }
            ],
            "format": "double",
            "nullable": true
          },
          "max": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "enum": [
                  null
                ],
                "nullable": true
              }
            ],
            "format": "double",
            "nullable": true
          }
        }
      },
      "SearchRequest": {
        "type": "object",
        "properties": {
          "q": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "filters": {
            "type": "object",
            "nullable": true
          },
          "rangeFilters": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SearchRangeFilter"
            },
            "nullable": true
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int32"
          },
          "size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int32"
          },
          "sort": {
            "oneOf": [
              {
                "enum": [
                  null
                ],
                "nullable": true
              },
              {
                "$ref": "#/components/schemas/SearchSort"
              }
            ]
          }
        }
      },
      "SearchResponse": {
        "required": [
          "total",
          "page",
          "size",
          "results",
          "facets"
        ],
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int64"
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int32"
          },
          "size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BibRecord"
            }
          },
          "facets": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/FacetItem"
              }
            }
          }
        }
      },
      "SearchSort": {
        "type": "object",
        "properties": {
          "by": {
            "type": "string",
            "nullable": true
          },
          "order": {
            "type": "string"
          }
        }
      },
      "SuggestItem": {
        "required": [
          "text",
          "field",
          "score"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "format": "double"
          },
          "recordId": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "SuggestResponse": {
        "required": [
          "q",
          "suggestions"
        ],
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "suggestions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SuggestItem"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Verso.Server"
    }
  ]
}