Option recommendations (experimental; quick mode; rules 2026-10-18)

Schema  OpenAPI 3.1.0 (OpenAPI scopes: schemas)
  components                       6, 1 operations
  inline objects / enums           8 / 2, nesting depth 1
  shared property names            0 (none)
  inline names = component names   0
  repeated inline objects / enums  2 of 1 shapes / 0 of 0 value sets
  titled components                0: 0 shared titles (none), 0 equal another key, 0 equal their own key
  inline titles                    0 objects, most repeated 0 (none)
  unions                           3 oneOf/anyOf, 1 with a discriminator, 12 inline variants
  union branch tags                2 tagged, 1 single required key, 1 tagged only through allOf $ref, 1 copy their parent
  component keys                   snake_case (2 of 6); 0 dotted in 0 namespaces
  constraint keywords              uniqueItems 0, patternProperties 0 (0 beyond a typed map), multipleOf 0, OpenAPI 3.0 nullable 0, boolean exclusive bounds 0
  formats                          0 (none), decimal 0; int32/int64 0, ranges not enforced
  integer/number/boolean schemas   0

Start from  --preset standard-py314-20261017

Add (2 options)
  --use-title-as-name   [titles.names-from-unique-titles]
      Inline union variants carry titles that no other schema uses (titled variants: 1, e.g. none).
      Titles name them after what they are, instead of their parent property and a number.
      measured: Train Travel API: BookingPayment.source variants became Card and BankAccount instead
      of Source and Source1
  --use-tag-as-union-variant-name   [unions.name-variants-after-tags]
      Inline oneOf/anyOf branches can be named after a tag or key (branches with a tag value no
      sibling shares: 2; objects with one required key: 1); otherwise they are named after their
      parent and a number.
      measured: OpenAI API description (59 tagged, 10 key branches): preset 797 -> 759 problem names
      (ThreadStreamEvent1 -> ThreadStreamEventThreadCreated)
      measured: GitHub REST API description (1 tagged, 4 key branches): preset 1808 -> 1805
      (Changes23 -> ChangesBody)
      measured: SchemaStore workflow schema (5 tagged): 49 -> 44 (WorkflowDispatchInput1 to 5 ->
      WorkflowDispatchInputString, Boolean, ...)
      measured: with full-path on the GitHub and OpenAI descriptions: no change in problem names;
      schemas without tagged or key branches: no change

Command
  datamodel-codegen --input union_edges.yaml --preset standard-py314-20261017 --target-python-version 3.14 --use-tag-as-union-variant-name --use-title-as-name

pyproject.toml
  [tool.datamodel-codegen]
  input = "union_edges.yaml"
  preset = "standard-py314-20261017"
  target-python-version = "3.14"
  use-tag-as-union-variant-name = true
  use-title-as-name = true
