{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fiatdock-com/json-schema/fiatdock-com-paper-search-schema.json",
  "title": "PaperSearch",
  "description": "Paid. Academic paper search (OpenAlex, ~250M works).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fiatdock-com-papers-api-openapi.yml#/components/schemas/PaperSearch",
  "type": "object",
  "properties": {
    "query": {
      "type": [
        "string",
        "null"
      ],
      "description": "The search query"
    },
    "filters": {
      "type": "object",
      "properties": {
        "fromYear": {
          "type": [
            "number",
            "null"
          ]
        },
        "toYear": {
          "type": [
            "number",
            "null"
          ]
        },
        "openAccessOnly": {
          "type": "boolean"
        },
        "sort": {
          "type": "string"
        }
      },
      "required": [
        "fromYear",
        "toYear",
        "openAccessOnly",
        "sort"
      ],
      "description": "The filters and order applied"
    },
    "totalMatched": {
      "type": [
        "number",
        "null"
      ],
      "description": "Works the index matched before the limit"
    },
    "count": {
      "type": "number",
      "description": "Papers returned"
    },
    "papers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authorCount": {
            "type": "number"
          },
          "year": {
            "type": [
              "number",
              "null"
            ]
          },
          "publicationDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "venue": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "doi": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "openAccess": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "openAccessUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "citedBy": {
            "type": [
              "number",
              "null"
            ]
          },
          "abstract": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "title",
          "authors",
          "authorCount",
          "year",
          "publicationDate",
          "venue",
          "type",
          "doi",
          "url",
          "openAccess",
          "openAccessUrl",
          "citedBy",
          "abstract"
        ]
      },
      "description": "The papers: title, authors (first 6), year, venue, DOI, citations, open-access link, abstract"
    },
    "source": {
      "type": "string",
      "description": "Which index answered (OpenAlex, or Crossref when OpenAlex did not)"
    },
    "asOf": {
      "type": "string",
      "description": "ISO time the index was read"
    },
    "note": {
      "type": "string",
      "description": "Whose text the titles and abstracts are, and the limits"
    },
    "defaulted": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "field",
        "to",
        "value",
        "note"
      ],
      "description": "Present only when the body was empty: which subject the answer is for, and why"
    }
  },
  "required": [
    "query",
    "filters",
    "totalMatched",
    "count",
    "papers",
    "source",
    "asOf",
    "note"
  ]
}