pub fn to_openapi3(value: &mut Value)Expand description
Rewrite vld’s JSON Schema (2020-12) into the OpenAPI 3.0 dialect, applied
when the generator uses SchemaSettings::openapi3():
- tuples (
prefixItems+items: false) becomeitems: {anyOf: [...]}with the existingminItems/maxItems; nullbranches ofanyOf/oneOfand"null"in atypearray becomenullable: true(a lone remaining$refis wrapped inallOf);- numeric
exclusiveMinimum/exclusiveMaximum(2020-12) becomeminimum/maximumplus the boolean 3.0exclusiveMinimum: true/exclusiveMaximum: true; - a schema that only allows
nullbecomes{"type": "string", "nullable": true, "enum": [null]}(3.0 ignoresnullablewithout atype, and has nonulltype).
Doing it here keeps schemars’ own OpenAPI 3.0 transforms from producing
additionalItems or {"enum": [null], "nullable": true}.