A scalar schema whose `oneOf` branches each carry `const` + `title` is
the spec-native way to express a named enum with per-value documentation
(OpenAPI 3.1 / JSON Schema 2020-12). Previously such schemas generated a
`json.RawMessage`-backed union; now they produce a regular Go enum with
titled constants and per-value doc comments sourced from `description`.
Detection is strict — every branch must carry both `const` and `title`,
and the outer schema must declare a scalar `type` (`string` or
`integer`) — so schemas that don't cleanly match fall through to the
existing oneOf union generator unchanged. The behavior is default-on;
`generation.skip-enum-via-oneof: true` restores the legacy output.
A scalar schema whose oneOf branches each carry const + title is the spec-native way to express a named enum with per-value documentation (OpenAPI 3.1 / JSON Schema 2020-12). Previously such schemas generated a json.RawMessage-backed union; now they produce a regular Go enum with titled constants and per-value doc comments sourced from description.
Detection is strict — every branch must carry both const and title, and the outer schema must declare a scalar type (string or integer) — so schemas that don't cleanly match fall through to the existing oneOf union generator unchanged. The behavior is default-on; generation.skip-enum-via-oneof: true restores the legacy output.