1111| [ ` --list-experimental ` ] ( #list-experimental ) | List registered experimental features |
1212| [ ` --no-color ` ] ( #no-color ) | Disable colorized output |
1313| [ ` --output-format ` ] ( #output-format ) | Choose the command output format |
14- | [ ` --output-format-json-schema ` ] ( #output-format-json-schema ) | Output JSON Schema for structured command output |
14+ | [ ` --output-format-json-schema ` ] ( #output-format-json-schema ) | Output JSON Schema for JSON output payloads |
1515| [ ` --profile ` ] ( #profile ) | Use a named profile from pyproject.toml |
1616| [ ` --version ` ] ( #version ) | Show program version and exit |
1717
@@ -227,11 +227,12 @@ is the generated module path.
227227
228228Use ` --output-format json ` with ` --generate-prompt ` to emit structured option
229229metadata instead of Markdown. Use ` --output-format-json-schema ` when an LLM
230- agent or tool needs the schema for a structured output payload.
230+ agent or tool needs the schema for a JSON payload.
231231
232232Schema targets are intentionally scoped. ` generate-prompt ` emits the
233233` PromptPayload ` schema for ` --generate-prompt --output-format json ` .
234234` generation ` emits only the ` GenerationPayload ` schema for generated-file JSON.
235+ ` model-metadata ` emits the schema for files written by ` --emit-model-metadata ` .
235236` structured-output ` emits the broader ` StructuredOutputPayload ` schema, a union
236237covering ` GenerationPayload ` , ` PromptPayload ` , ` CommandOutputPayload ` , and
237238` CheckOutputPayload ` . Structured payloads use ` kind ` as the discriminator.
@@ -244,15 +245,17 @@ covering `GenerationPayload`, `PromptPayload`, `CommandOutputPayload`, and
244245 datamodel-codegen --generate-prompt --output-format json # (3)!
245246 datamodel-codegen --output-format-json-schema generation # (4)!
246247 datamodel-codegen --output-format-json-schema generate-prompt # (5)!
247- datamodel-codegen --output-format-json-schema structured-output # (6)!
248+ datamodel-codegen --output-format-json-schema model-metadata # (6)!
249+ datamodel-codegen --output-format-json-schema structured-output # (7)!
248250 ```
249251
250252 1. :material-arrow-left: Emit the default generated Python text
251253 2. :material-arrow-left: Emit structured JSON containing generated files
252254 3. :material-arrow-left: Emit structured JSON with current options and argparse metadata
253255 4. :material-arrow-left: Emit JSON Schema for generated-file JSON output
254256 5. :material-arrow-left: Emit JSON Schema for structured prompt JSON
255- 6. :material-arrow-left: Emit JSON Schema for any structured command JSON output
257+ 6. :material-arrow-left: Emit JSON Schema for generated model metadata JSON
258+ 7. :material-arrow-left: Emit JSON Schema for any structured command JSON output
256259
257260??? example "Generation JSON output"
258261
@@ -285,7 +288,7 @@ covering `GenerationPayload`, `PromptPayload`, `CommandOutputPayload`, and
285288
286289## ` --output-format-json-schema ` {#output-format-json-schema}
287290
288- Output JSON Schema for a structured command output format and exit.
291+ Output JSON Schema for a JSON output format and exit.
289292
290293Use this when an LLM agent, tool call definition, or validation layer needs the
291294contract before consuming JSON output. The schema is emitted separately from the
@@ -296,6 +299,7 @@ Currently supported schema targets:
296299
297300- ` generate-prompt ` : schema for ` --generate-prompt --output-format json `
298301- ` generation ` : schema for normal generation with ` --output-format json `
302+ - ` model-metadata ` : schema for files emitted by ` --emit-model-metadata `
299303- ` structured-output ` : tagged union schema for all structured command outputs,
300304 discriminated by ` kind `
301305
@@ -304,16 +308,18 @@ Currently supported schema targets:
304308 ```bash
305309 datamodel-codegen --output-format-json-schema generate-prompt # (1)!
306310 datamodel-codegen --output-format-json-schema generation # (2)!
307- datamodel-codegen --output-format-json-schema structured-output # (3)!
308- datamodel-codegen --generate-prompt --output-format json # (4)!
309- datamodel-codegen --input schema.json --output-format json # (5)!
311+ datamodel-codegen --output-format-json-schema model-metadata # (3)!
312+ datamodel-codegen --output-format-json-schema structured-output # (4)!
313+ datamodel-codegen --generate-prompt --output-format json # (5)!
314+ datamodel-codegen --input schema.json --emit-model-metadata model-map.json # (6)!
310315 ```
311316
312317 1. :material-arrow-left: Emit the JSON Schema for structured prompt output
313318 2. :material-arrow-left: Emit the JSON Schema for generated-file output
314- 3. :material-arrow-left: Emit the JSON Schema for all structured command outputs
315- 4. :material-arrow-left: Emit prompt payloads that match the prompt schema
316- 5. :material-arrow-left: Emit generation payloads that match the generation schema
319+ 3. :material-arrow-left: Emit the JSON Schema for generated model metadata
320+ 4. :material-arrow-left: Emit the JSON Schema for all structured command outputs
321+ 5. :material-arrow-left: Emit prompt payloads that match the prompt schema
322+ 6. :material-arrow-left: Emit metadata payloads that match the model metadata schema
317323
318324---
319325
0 commit comments