| 1 | { |
| 2 | "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | "$id": "https://effect.website/schemas/ai-codegen.json", |
| 4 | "title": "Effect AI Codegen Configuration", |
| 5 | "description": "Configuration for @effect/ai-codegen code generation", |
| 6 | "type": "object", |
| 7 | "required": ["spec", "output"], |
| 8 | "properties": { |
| 9 | "spec": { |
| 10 | "description": "OpenAPI specification source - URL, file path, or structured resolver config", |
| 11 | "oneOf": [ |
| 12 | { |
| 13 | "type": "string", |
| 14 | "description": "URL or file path to the OpenAPI specification" |
| 15 | }, |
| 16 | { |
| 17 | "type": "object", |
| 18 | "description": "Stainless stats resolver - fetches stats.yml and extracts openapi_spec_url", |
| 19 | "required": ["type", "statsUrl"], |
| 20 | "additionalProperties": false, |
| 21 | "properties": { |
| 22 | "type": { |
| 23 | "const": "stainless-stats", |
| 24 | "description": "Resolver type" |
| 25 | }, |
| 26 | "statsUrl": { |
| 27 | "type": "string", |
| 28 | "format": "uri", |
| 29 | "description": "URL to Stainless .stats.yml file containing openapi_spec_url" |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | ] |
| 34 | }, |
| 35 | "output": { |
| 36 | "type": "string", |
| 37 | "description": "Output file path relative to the package directory" |
| 38 | }, |
| 39 | "name": { |
| 40 | "type": "string", |
| 41 | "description": "Name for the generated client (defaults to 'Client')" |
| 42 | }, |
| 43 | "typeOnly": { |
| 44 | "type": "boolean", |
| 45 | "description": "Generate type-only output without runtime code", |
| 46 | "default": false |
| 47 | }, |
| 48 | "header": { |
| 49 | "type": "string", |
| 50 | "description": "Content to prepend to the generated file (e.g. module-level JSDoc)" |
| 51 | }, |
| 52 | "patches": { |
| 53 | "type": "array", |
| 54 | "description": "JSON Patch documents to apply to the spec before generation. Each item can be a file path or inline JSON array.", |
| 55 | "items": { |
| 56 | "type": "string" |
| 57 | } |
| 58 | }, |
| 59 | "replacements": { |
| 60 | "type": "array", |
| 61 | "description": "Text replacements to apply to generated code.", |
| 62 | "items": { |
| 63 | "type": "object", |
| 64 | "required": ["from", "to"], |
| 65 | "additionalProperties": false, |
| 66 | "properties": { |
| 67 | "from": { |
| 68 | "type": "string", |
| 69 | "description": "The string to search for" |
| 70 | }, |
| 71 | "to": { |
| 72 | "type": "string", |
| 73 | "description": "The string to replace with" |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | }, |
| 78 | "excludeAnnotations": { |
| 79 | "type": "array", |
| 80 | "description": "Annotation keys to exclude from generated schema code (e.g. [\"examples\"]).", |
| 81 | "items": { |
| 82 | "type": "string" |
| 83 | } |
| 84 | }, |
| 85 | "disableAdditionalProperties": { |
| 86 | "type": "boolean", |
| 87 | "description": "When true, forces additionalProperties to false on all object schemas, preventing StructWithRest emission.", |
| 88 | "default": false |
| 89 | } |
| 90 | }, |
| 91 | "additionalProperties": false |
| 92 | } |