{
  "openapi": "3.1.0",
  "info": {
    "title": "Sampuli API",
    "version": "1.0.0",
    "summary": "Free, format-true synthetic test data for 90 countries.",
    "description": "Country-accurate synthetic test data — national IDs, IBANs, SWIFT/BIC, cards, phones, companies, products — plus generic types (uuid, enum, int…) and custom schemas. Every value is synthetic; identifier types carry real check digits. No key, CORS-open. Docs: https://sampuli.site/api",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    },
    "contact": {
      "name": "Sampuli",
      "url": "https://sampuli.site"
    }
  },
  "servers": [
    {
      "url": "https://sampuli.site/api/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "catalogue",
      "description": "What is available"
    },
    {
      "name": "generate",
      "description": "Generate data"
    },
    {
      "name": "schema",
      "description": "Custom schemas & batches"
    },
    {
      "name": "validate",
      "description": "Check a value against a standards validator"
    },
    {
      "name": "agent",
      "description": "Plain-language access for AI agents"
    }
  ],
  "paths": {
    "/fetch": {
      "get": {
        "tags": [
          "agent"
        ],
        "summary": "Fetch data from a plain-language request",
        "operationId": "fetch",
        "description": "Resolve a natural request (\"a SWIFT code for China\", \"Kenya phone number\") to a spec and generate it in one call. Sampuli maps the country (China→cn) and field (\"SWIFT code\"→swift) for you. The JSON response echoes the resolved `spec` so the caller can see the interpretation.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Plain-language request, e.g. \"a swift code for china\".",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "a swift code for china"
          },
          {
            "name": "n",
            "in": "query",
            "description": "How many rows (omit for one). Capped at 1000 on the free API.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "example": 100
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated field keys, or \"all\". Applies to person/full records.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "name,phone,account"
          },
          {
            "name": "seed",
            "in": "query",
            "description": "Reproducible output — same seed, same data.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Response format.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "ndjson",
                "xml"
              ],
              "default": "json"
            }
          },
          {
            "name": "pretty",
            "in": "query",
            "description": "Pretty-print JSON.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The resolved spec and generated data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "spec": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "field": {
                      "type": "string",
                      "nullable": true
                    },
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/resolve": {
      "get": {
        "tags": [
          "agent"
        ],
        "summary": "Interpret a plain-language request (no data)",
        "operationId": "resolve",
        "description": "Turn a natural request into a spec without generating — useful to confirm how the words were understood.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Plain-language request.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "german passport"
          }
        ],
        "responses": {
          "200": {
            "description": "The interpretation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "spec": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "field": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/countries": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "List all countries",
        "operationId": "listCountries",
        "responses": {
          "200": {
            "description": "Every country with metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Country"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/catalog": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "Full country×field capability map",
        "operationId": "catalog",
        "description": "Every country with all its fields (each flagged `certified` when a checksum/standards validator backs it) and preset keys — the whole capability in one call, for agents.",
        "responses": {
          "200": {
            "description": "The full catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/fields": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "Reverse index — every field and its countries",
        "operationId": "fields",
        "description": "Every field key with how many countries generate it (and how many are certified). Use /fields/{field} to get the actual country list.",
        "responses": {
          "200": {
            "description": "The field index.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer"
                          },
                          "certified": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/fields/{field}": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "Which countries have a field",
        "operationId": "fieldCountries",
        "description": "Which countries generate a given field — e.g. \"which countries have an IBAN / SWIFT / national id?\". Accepts synonyms (bic→swift, zip→postcode).",
        "parameters": [
          {
            "name": "field",
            "in": "path",
            "description": "A field key or synonym.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "iban"
          }
        ],
        "responses": {
          "200": {
            "description": "The countries offering the field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "certified": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/types": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "List generic field types",
        "operationId": "listTypes",
        "responses": {
          "200": {
            "description": "The generic types usable as any.<type> or in a schema.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TypeInfo"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/validators": {
      "get": {
        "tags": [
          "validate"
        ],
        "summary": "List checksum/standards validators",
        "operationId": "listValidators",
        "responses": {
          "200": {
            "description": "Every validator as { id, label }.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "validators": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/validate": {
      "get": {
        "tags": [
          "validate"
        ],
        "summary": "Validate a value",
        "operationId": "validateGet",
        "description": "Check whether a value is format-valid. Identify the check by `validator` id (see /validators) or by `spec` (a country field like `de.account`, `tr.id`).",
        "parameters": [
          {
            "name": "value",
            "in": "query",
            "description": "The value to check.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "validator",
            "in": "query",
            "description": "Validator id (see /validators).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "spec",
            "in": "query",
            "description": "Country field spec, e.g. de.account or tr.id.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "validate"
        ],
        "summary": "Validate one or many values",
        "operationId": "validatePost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "checks": [
                  {
                    "value": "DE89370400440532013000",
                    "validator": "iban"
                  },
                  {
                    "value": "90302240730",
                    "spec": "tr.id"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A single result, or { count, results } for a batch.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/{country}": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "Describe a country's fields & presets",
        "operationId": "describeCountry",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "ISO country code.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ae",
                "ao",
                "ar",
                "at",
                "au",
                "bd",
                "be",
                "bg",
                "bh",
                "br",
                "bw",
                "ca",
                "cd",
                "ch",
                "ci",
                "cl",
                "cm",
                "cn",
                "co",
                "cz",
                "de",
                "dk",
                "dz",
                "ec",
                "ee",
                "eg",
                "es",
                "et",
                "fi",
                "fr",
                "gb",
                "gh",
                "gr",
                "hk",
                "hr",
                "hu",
                "id",
                "ie",
                "il",
                "in",
                "is",
                "it",
                "jo",
                "jp",
                "ke",
                "kr",
                "kw",
                "lb",
                "lk",
                "lt",
                "lu",
                "lv",
                "ma",
                "mu",
                "mx",
                "my",
                "mz",
                "na",
                "ng",
                "nl",
                "no",
                "nz",
                "om",
                "pe",
                "ph",
                "pk",
                "pl",
                "pt",
                "qa",
                "ro",
                "rs",
                "rw",
                "sa",
                "se",
                "sg",
                "si",
                "sk",
                "sn",
                "th",
                "tn",
                "tr",
                "tz",
                "ua",
                "ug",
                "us",
                "uy",
                "vn",
                "za",
                "zm",
                "zw"
              ]
            },
            "example": "ke"
          }
        ],
        "responses": {
          "200": {
            "description": "Country metadata, record types, fields and presets.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountryDetail"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/{country}/{selector}": {
      "get": {
        "tags": [
          "generate"
        ],
        "summary": "Generate country data",
        "operationId": "generate",
        "description": "Selector is a field key (`phone`), `person` (core record), `full` (every field), `company`, `product`, or `preset:<key>`.",
        "parameters": [
          {
            "name": "country",
            "in": "path",
            "description": "ISO country code.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ae",
                "ao",
                "ar",
                "at",
                "au",
                "bd",
                "be",
                "bg",
                "bh",
                "br",
                "bw",
                "ca",
                "cd",
                "ch",
                "ci",
                "cl",
                "cm",
                "cn",
                "co",
                "cz",
                "de",
                "dk",
                "dz",
                "ec",
                "ee",
                "eg",
                "es",
                "et",
                "fi",
                "fr",
                "gb",
                "gh",
                "gr",
                "hk",
                "hr",
                "hu",
                "id",
                "ie",
                "il",
                "in",
                "is",
                "it",
                "jo",
                "jp",
                "ke",
                "kr",
                "kw",
                "lb",
                "lk",
                "lt",
                "lu",
                "lv",
                "ma",
                "mu",
                "mx",
                "my",
                "mz",
                "na",
                "ng",
                "nl",
                "no",
                "nz",
                "om",
                "pe",
                "ph",
                "pk",
                "pl",
                "pt",
                "qa",
                "ro",
                "rs",
                "rw",
                "sa",
                "se",
                "sg",
                "si",
                "sk",
                "sn",
                "th",
                "tn",
                "tr",
                "tz",
                "ua",
                "ug",
                "us",
                "uy",
                "vn",
                "za",
                "zm",
                "zw"
              ]
            },
            "example": "de"
          },
          {
            "name": "selector",
            "in": "path",
            "description": "Field key, person, full, company, product, or preset:<key>.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "person"
          },
          {
            "name": "n",
            "in": "query",
            "description": "How many rows (omit for one). Capped at 1000 on the free API.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "example": 100
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated field keys, or \"all\". Applies to person/full records.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "name,phone,account"
          },
          {
            "name": "seed",
            "in": "query",
            "description": "Reproducible output — same seed, same data.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Response format.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "ndjson",
                "xml"
              ],
              "default": "json"
            }
          },
          {
            "name": "pretty",
            "in": "query",
            "description": "Pretty-print JSON.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated data (JSON array/object/scalar; text for csv/ndjson).",
            "content": {
              "application/json": {},
              "text/csv": {},
              "application/x-ndjson": {}
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/any/{type}": {
      "get": {
        "tags": [
          "generate"
        ],
        "summary": "Generate a generic value",
        "operationId": "any",
        "description": "Parameterised types use a colon: `int:1,100`, `enum:a,b,c`, `date:2020,2025`.",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "description": "A generic type, optionally with :params.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "uuid"
          },
          {
            "name": "n",
            "in": "query",
            "description": "How many rows (omit for one). Capped at 1000 on the free API.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "example": 100
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated field keys, or \"all\". Applies to person/full records.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "name,phone,account"
          },
          {
            "name": "seed",
            "in": "query",
            "description": "Reproducible output — same seed, same data.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Response format.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "ndjson",
                "xml"
              ],
              "default": "json"
            }
          },
          {
            "name": "pretty",
            "in": "query",
            "description": "Pretty-print JSON.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated data (JSON array/object/scalar; text for csv/ndjson).",
            "content": {
              "application/json": {},
              "text/csv": {},
              "application/x-ndjson": {}
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/schema": {
      "get": {
        "tags": [
          "schema"
        ],
        "summary": "Custom-schema usage help",
        "operationId": "schemaHelp",
        "responses": {
          "200": {
            "description": "The request shape for POST /schema.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "schema"
        ],
        "summary": "Generate rows from a custom schema",
        "operationId": "schema",
        "description": "Mix generic types and country field specs into one row. Per-field `blank` (0–1) makes it null that often.",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "description": "json (default), csv or ndjson.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "ndjson",
                "xml"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Schema"
              },
              "example": {
                "count": 100,
                "seed": "demo",
                "fields": [
                  {
                    "name": "id",
                    "type": "uuid"
                  },
                  {
                    "name": "phone",
                    "type": "ke.phone"
                  },
                  {
                    "name": "plan",
                    "type": "enum:free,pro,team"
                  },
                  {
                    "name": "mrr",
                    "type": "int:0,500",
                    "blank": 0.1
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated data (JSON array/object/scalar; text for csv/ndjson).",
            "content": {
              "application/json": {},
              "text/csv": {},
              "application/x-ndjson": {}
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/batch": {
      "get": {
        "tags": [
          "schema"
        ],
        "summary": "Many specs in one call (DSL)",
        "operationId": "batchGet",
        "parameters": [
          {
            "name": "specs",
            "in": "query",
            "description": "Comma-separated country.selector[:count][@fields]. e.g. ng.phone,ke.full:3,de.person@name+card",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "ng.phone,ke.full:3,de.company"
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated field keys, or \"all\". Applies to person/full records.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "name,phone,account"
          },
          {
            "name": "seed",
            "in": "query",
            "description": "Reproducible output — same seed, same data.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pretty",
            "in": "query",
            "description": "Pretty-print JSON.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results in request order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "schema"
        ],
        "summary": "Many specs in one call (full control)",
        "operationId": "batchPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "requests": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/BatchRequest"
                    }
                  }
                },
                "required": [
                  "requests"
                ]
              },
              "example": {
                "requests": [
                  {
                    "spec": "ng.phone",
                    "key": "ceo_phone"
                  },
                  {
                    "spec": "ke.person",
                    "n": 3,
                    "fields": [
                      "name",
                      "phone"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results in request order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Country": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "flag": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "group": {
            "type": "string"
          }
        }
      },
      "CountryDetail": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "records": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "person",
                "full",
                "company",
                "product"
              ]
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          },
          "presets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Field": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "default": {
            "type": "boolean",
            "description": "Included in a plain person record."
          },
          "num": {
            "type": "boolean"
          },
          "money": {
            "type": "boolean"
          },
          "img": {
            "type": "boolean"
          }
        }
      },
      "TypeInfo": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "uuid",
              "guid",
              "objectid",
              "sequence",
              "bool",
              "int",
              "float",
              "digits",
              "string",
              "enum",
              "date",
              "datetime",
              "time",
              "timestamp",
              "word",
              "words",
              "sentence",
              "paragraph",
              "slug",
              "email",
              "username",
              "domain",
              "url",
              "ipv4",
              "ipv6",
              "mac",
              "port",
              "color",
              "vin",
              "isbn",
              "imei",
              "ean",
              "card",
              "eth"
            ]
          },
          "label": {
            "type": "string"
          },
          "params": {
            "type": "string"
          }
        }
      },
      "ValidateResult": {
        "type": "object",
        "properties": {
          "value": {},
          "spec": {
            "type": "string"
          },
          "validator": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "valid": {
            "type": "boolean",
            "nullable": true
          },
          "error": {
            "type": "string"
          }
        }
      },
      "SchemaField": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "A generic type (\"uuid\", \"int:0,500\") or a country field spec (\"ke.phone\")."
          },
          "blank": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "Schema": {
        "type": "object",
        "required": [
          "fields"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 1
          },
          "seed": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SchemaField"
            }
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "required": [
          "spec"
        ],
        "properties": {
          "spec": {
            "type": "string"
          },
          "n": {
            "type": "integer"
          },
          "fields": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string",
                "enum": [
                  "all"
                ]
              }
            ]
          },
          "seed": {
            "type": "string"
          },
          "key": {
            "type": "string"
          }
        }
      },
      "BatchResult": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "spec": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "data": {},
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}