Open wsalembi opened 8 years ago
The following JSON schema (dummy.json) generates 3 classes: BillingAddress, ShippingAddress and Dummy.
{ "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "address": { "type": "object", "properties": { "street_address": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" } }, "required": ["street_address", "city", "state"] } }, "type": "object", "properties": { "billing_address": { "$ref": "#/definitions/address" }, "shipping_address": { "$ref": "#/definitions/address" } } }
Why not generate a single Address class and reuse it for the two properties? I know it can be achieved by specifying javaType. But a generation option to enforce this rule globally would be really helpful.
The following JSON schema (dummy.json) generates 3 classes: BillingAddress, ShippingAddress and Dummy.
Why not generate a single Address class and reuse it for the two properties? I know it can be achieved by specifying javaType. But a generation option to enforce this rule globally would be really helpful.