{
    "openapi": "3.0.0",
    "info": {
        "title": "Foundry API",
        "description": "A small, read-only, versioned JSON API over Foundry's component\ncatalogue. Public, with no authentication: everything here is\nsample data. Errors are application/problem+json (RFC 9457),\nand every response carries an ETag for conditional requests.\n",
        "version": "1.0"
    },
    "servers": [
        {
            "url": "/"
        }
    ],
    "paths": {
        "/api/v1/components": {
            "get": {
                "tags": [
                    "Components"
                ],
                "summary": "List components, optionally filtered and paginated.",
                "operationId": "get_api_components_list",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Filter by name or category (case-insensitive substring).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, 1-based.",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page, 1-50.",
                        "schema": {
                            "type": "integer",
                            "default": 8,
                            "maximum": 50,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of components.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "slug": {
                                                        "type": "string",
                                                        "example": "stat-card"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Stat card"
                                                    },
                                                    "category": {
                                                        "type": "string",
                                                        "example": "Data"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "stable",
                                                        "enum": [
                                                            "stable",
                                                            "planned"
                                                        ]
                                                    },
                                                    "used_in_apps": {
                                                        "type": "integer",
                                                        "example": 4
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "example": "2026-08-02"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "meta": {
                                            "properties": {
                                                "page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "total_pages": {
                                                    "type": "integer",
                                                    "example": 3
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 22
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 8
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "slug": "stat-card",
                                            "name": "Stat card",
                                            "category": "Data",
                                            "status": "stable",
                                            "used_in_apps": 4,
                                            "updated_at": "2026-08-02"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "total_pages": 3,
                                        "total": 22,
                                        "per_page": 8
                                    }
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not modified - the client's If-None-Match matched."
                    },
                    "400": {
                        "description": "per_page out of range.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "type": {
                                            "type": "string",
                                            "example": "about:blank"
                                        },
                                        "title": {
                                            "type": "string",
                                            "example": "Bad Request"
                                        },
                                        "status": {
                                            "type": "integer",
                                            "example": 400
                                        },
                                        "detail": {
                                            "type": "string",
                                            "example": "per_page must be between 1 and 50."
                                        },
                                        "instance": {
                                            "type": "string",
                                            "example": "/api/v1/components"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/components/{slug}": {
            "get": {
                "tags": [
                    "Components"
                ],
                "summary": "Fetch one component by its slug.",
                "operationId": "get_api_components_show",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "stat-card"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The component.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "slug": {
                                            "type": "string",
                                            "example": "stat-card"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "Stat card"
                                        },
                                        "category": {
                                            "type": "string",
                                            "example": "Data"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "stable",
                                            "enum": [
                                                "stable",
                                                "planned"
                                            ]
                                        },
                                        "used_in_apps": {
                                            "type": "integer",
                                            "example": 4
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date",
                                            "example": "2026-08-02"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No component with that slug.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "type": {
                                            "type": "string",
                                            "example": "about:blank"
                                        },
                                        "title": {
                                            "type": "string",
                                            "example": "Not Found"
                                        },
                                        "status": {
                                            "type": "integer",
                                            "example": 404
                                        },
                                        "detail": {
                                            "type": "string",
                                            "example": "No component with slug \"nope\"."
                                        },
                                        "instance": {
                                            "type": "string",
                                            "example": "/api/v1/components/nope"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "tags": [
        {
            "name": "Components"
        }
    ]
}