# JSON Schema Template
# Defines the structure and constraints of your data
#
# Usage:
#   from pycharter import from_dict
#   Model = from_dict(schema, "MyModel")

type: object
title: my_entity
version: "1.0.0"

properties:
  # Required string field
  id:
    type: string
    description: Unique identifier
    title: ID
    minLength: 1

  # Required string with max length
  name:
    type: string
    description: Entity name
    title: Name
    minLength: 1
    maxLength: 100

  # Enum field
  status:
    type: string
    description: Current status
    enum: [active, inactive, pending]

  # Integer with constraints
  count:
    type: integer
    description: Item count
    minimum: 0

  # Number (float) with constraints
  amount:
    type: number
    description: Monetary amount
    minimum: 0

  # Boolean field
  is_active:
    type: boolean
    description: Active flag
    default: true

  # Date-time field
  created_at:
    type: string
    format: date-time
    description: Creation timestamp

  # Email field
  email:
    type: string
    format: email
    description: Contact email

  # UUID field
  uuid:
    type: string
    format: uuid
    description: Unique UUID

  # Optional/nullable field (use anyOf for nullable)
  notes:
    anyOf:
      - type: string
        maxLength: 500
      - type: "null"
    default: null
    description: Optional notes

  # Nested object
  metadata:
    type: object
    properties:
      source:
        type: string
      version:
        type: string
    required: [source]

  # Array of strings
  tags:
    type: array
    items:
      type: string
    description: Tags list

required:
  - id
  - name
  - status
  - created_at
