{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nanobaselabs-com/json-schema/nanobaselabs-com-sources-schema.json",
  "title": "Sources",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nanobaselabs-com-openapi.json#/components/schemas/Sources",
  "anyOf": [
    {
      "$ref": "#/$defs/Source"
    },
    {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "items": {
        "$ref": "#/$defs/Source"
      }
    }
  ],
  "$defs": {
    "Source": {
      "type": "object",
      "required": [
        "doc_type"
      ],
      "additionalProperties": false,
      "description": "A supplier document that confirms an ingredient's information. Ask your user to upload it and send its text. Stored, never fetched; the text is kept privately and never returned or shown to other users; responses echo doc_type and doc_date only. A submission is used right away for your own account and added to the shared library after review by Pensive Beauty® Nanoscience Labs; a document whose text (doc_type plus at least about 200 characters) names the ingredient supports the review (a url alone does not count). Invalid sources return 400 invalid_source with the field.",
      "properties": {
        "doc_type": {
          "type": "string",
          "enum": [
            "TDS",
            "SDS",
            "CoA",
            "spec"
          ]
        },
        "supplier": {
          "type": "string",
          "maxLength": 120
        },
        "doc_date": {
          "type": "string",
          "description": "YYYY, YYYY-MM or YYYY-MM-DD"
        },
        "url": {
          "type": "string",
          "maxLength": 500,
          "description": "http(s); never fetched"
        },
        "excerpt": {
          "type": "string",
          "description": "accepted as the same field as text"
        },
        "text": {
          "type": "string",
          "description": "the document text, up to 200 KB (204,800 bytes UTF-8)"
        }
      }
    }
  }
}