{
    "openapi": "3.0.3",
    "info": {
        "title": "Faker Forge Data API",
        "version": "1.0.0",
        "description": "HTTP API for Faker Forge data generation. Send a Bearer token in Authorization header."
    },
    "servers": [
        {
            "url": "https://fakerforge.com"
        }
    ],
    "components": {
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "Token"
            }
        }
    },
    "security": [
        {
            "BearerAuth": []
        }
    ],
    "paths": {
        "/api/{schemaId}/{table}": {
            "get": {
                "summary": "Fetch generated rows for a parsed schema table",
                "parameters": [
                    {
                        "name": "schemaId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Faker Forge schema ID"
                    },
                    {
                        "name": "table",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Table name in the schema"
                    },
                    {
                        "name": "rows",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 100
                        },
                        "description": "Number of rows to return, capped by plan limits"
                    },
                    {
                        "name": "columns",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Comma-separated list of fields to include"
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        },
                        "description": "Page number for pagination"
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 100
                        },
                        "description": "Page size for pagination"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "rows_requested": {
                                                    "type": "integer"
                                                },
                                                "limit": {
                                                    "type": "integer"
                                                },
                                                "offset": {
                                                    "type": "integer"
                                                },
                                                "page": {
                                                    "type": "integer"
                                                }
                                            }
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Schema or table not found"
                    },
                    "429": {
                        "description": "Plan API request limit exceeded"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                }
            }
        }
    }
}
