{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Add Component",
  "description": "Add an infrastructure component to a project's blueprint. Each component is a specific instance of a bundle (like a Redis cache or PostgreSQL database) that composes with other components to form your application.",
  "type": "object",
  "required": ["id", "name"],
  "properties": {
    "id": {
      "type": "string",
      "title": "Component ID",
      "description": "A short, memorable identifier for this component. This becomes the final segment of package identifiers. For example, project 'ecomm' with environment 'prod' and component 'db' creates 'ecomm-prod-db'. Max 20 characters, lowercase alphanumeric only (a-z, 0-9). Immutable after creation.",
      "minLength": 1,
      "maxLength": 20,
      "pattern": "^[a-z0-9]{1,20}$",
      "examples": ["database", "cache", "api", "queue"]
    },
    "name": {
      "type": "string",
      "title": "Component Name",
      "description": "Display name for this component (e.g., 'Billing Database')",
      "minLength": 1,
      "examples": ["Billing Database", "Session Cache", "API Gateway"]
    },
    "description": {
      "type": "string",
      "title": "Component Description",
      "description": "Optional description of this component's purpose",
      "maxLength": 255,
      "examples": ["Redis instance for caching API responses", "PostgreSQL database for user data"]
    },
    "attributes": {
      "type": "object",
      "title": "Attributes",
      "description": "Key-value attributes for this component. Keys and values must be strings. Must conform to the organization's custom attributes for the component scope.",
      "additionalProperties": { "type": "string" },
      "default": {},
      "x-gql-type": "map"
    }
  }
}
