Expand description
Map scythe’s neutral type strings to OpenAPI 3.1 JSON Schema fragments.
Scythe’s type system is documented at
scythe-core/src/analyzer/type_conversion.rs. The canonical neutral types
are: int16, int32, int64, float32, float64, string, bool,
bytes, uuid, date, datetime, datetime_tz, time, time_tz,
interval, json, inet, decimal, plus the composite forms
array<T>, range<T>, enum::<name>, composite::<name>, and
json_typed<TypeName> (produced by scythe’s @json mapping).
Nullability is layered by json_schema_for which wraps the schema with
{"oneOf": [<schema>, {"type": "null"}]} when nullable is true. This is
the OpenAPI 3.1 idiom (3.0’s "nullable": true flag is not used).
Structs§
- Build
Options - Build-time knobs for the neutral-type → JSON Schema mapping.
Enums§
Functions§
- json_
schema_ for - Wrap
neutral_to_json_schema’s output for nullability when the column or parameter is nullable. - neutral_
to_ json_ schema - Translate a single neutral type string to a JSON Schema fragment. Does not
apply nullability — see
json_schema_forfor the wrapper that does.