Skip to content
Source
Sign inSign up
Open History to see the last commit

codegen.schema.json

89 lines3.1 KB

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 "type": "string",
11 "description": "URL or file path to the OpenAPI specification (JSON or YAML, optionally gzipped with a .gz suffix)"
12 },
13 "output": {
14 "type": "string",
15 "description": "Output file path relative to the package directory"
16 },
17 "name": {
18 "type": "string",
19 "description": "Name for the generated client (defaults to 'Client')"
20 },
21 "typeOnly": {
22 "type": "boolean",
23 "description": "Generate type-only output without runtime code",
24 "default": false
25 },
26 "header": {
27 "type": "string",
28 "description": "Content to prepend to the generated file (e.g. module-level JSDoc)"
29 },
30 "patches": {
31 "type": "array",
32 "description": "JSON Patch documents to apply to the spec before generation. Each item can be a file path or inline JSON array.",
33 "items": {
34 "type": "string"
35 }
36 },
37 "includePaths": {
38 "type": "array",
39 "description": "Path prefixes to generate. Paths that match none of the prefixes are dropped after patches are applied. Defaults to every path.",
40 "items": {
41 "type": "string"
42 }
43 },
44 "includeSchemas": {
45 "type": "array",
46 "description": "Component schemas to generate even when no operation references them, such as stream events or deprecated legacy contracts.",
47 "items": {
48 "type": "string"
49 }
50 },
51 "collapseErrorResponses": {
52 "type": "boolean",
53 "description": "Replace each operation's explicit 4xx and 5xx responses with one 4XX response using the error envelope component they share. Generation fails when an operation's error responses do not reference exactly one component.",
54 "default": false
55 },
56 "replacements": {
57 "type": "array",
58 "description": "Text replacements to apply to generated code.",
59 "items": {
60 "type": "object",
61 "required": ["from", "to"],
62 "additionalProperties": false,
63 "properties": {
64 "from": {
65 "type": "string",
66 "description": "The string to search for"
67 },
68 "to": {
69 "type": "string",
70 "description": "The string to replace with"
71 }
72 }
73 }
74 },
75 "excludeAnnotations": {
76 "type": "array",
77 "description": "Annotation keys to exclude from generated schema code (e.g. [\"examples\"]).",
78 "items": {
79 "type": "string"
80 }
81 },
82 "disableAdditionalProperties": {
83 "type": "boolean",
84 "description": "When true, closes object schemas that declare properties and no additionalProperties of their own, preventing StructWithRest emission. Object compositions (allOf, and properties next to anyOf/oneOf) are merged before closing.",
85 "default": false
86 }
87 },
88 "additionalProperties": false