Closed blakeSaucier closed 1 year ago
Hello,
Consider the following DU type:
type Promo = | Percent of decimal type Pricing = | Nothing | Amount of decimal type Price = { Pricing: Pricing Promo: Promo Total: decimal }
This will result in the following shema:
Notice that Decimal and Decimal2 show up as definitions.
Decimal
Decimal2
I think this is a rather small fix and can work on an pr.
Hello,
Consider the following DU type:
This will result in the following shema:
schema
```json { "properties": { "pricing": { "$ref": "#/definitions/Pricing" }, "promo": { "$ref": "#/definitions/Promo/definitions/Percent" }, "total": { "type": "number", "format": "decimal" } }, "definitions": { "Pricing": { "definitions": { "Nothing": { "type": "string", "default": "Nothing", "additionalProperties": false, "x-enumNames": [ "Nothing" ], "enum": [ "Nothing" ] }, "Amount": { "type": "object", "additionalProperties": false, "required": [ "kind", "item" ], "properties": { "kind": { "type": "string", "default": "Amount", "x-enumNames": [ "Amount" ], "enum": [ "Amount" ] }, "item": { "$ref": "#/definitions/Decimal" } } } }, "anyOf": [ { "$ref": "#/definitions/Pricing/definitions/Nothing" }, { "$ref": "#/definitions/Pricing/definitions/Amount" } ] }, "Decimal": { "title": "Decimal", "type": "number", "format": "decimal" }, "Promo": { "definitions": { "Percent": { "type": "object", "additionalProperties": false, "required": [ "kind", "item" ], "properties": { "kind": { "type": "string", "default": "Percent", "x-enumNames": [ "Percent" ], "enum": [ "Percent" ] }, "item": { "$ref": "#/definitions/Decimal2" } } } }, "anyOf": [ { "$ref": "#/definitions/Promo/definitions/Percent" } ] }, "Decimal2": { "title": "Decimal", "type": "number", "format": "decimal" } } } ```Notice that
Decimal
andDecimal2
show up as definitions.I think this is a rather small fix and can work on an pr.