-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Belgian Remittance Information #3
Conversation
Added 'structured' / 'unstructured' properties as properties to BelgianRemittanceInformation, because previous draft with 'oneOf' for string field would require clients to do regexp to check type. |
Removed the oneOf, because its difficult to use with code generation. So now same as swagger version. With oneOf, it generates a type for the BelgianRemittanceInformation with both structured and unstructured properties, and then two "BelgianRemittanceInformationOneOf" and "BelgianRemittanceInformationOneOf1" for the inline objects in the oneOf, but without any inheritance relation between them. |
As alternative to oneOf, add minProperties: 1, maxProperties:1 which also enforces exactly one occurrence. |
When using It's more readable than the min/maxProperties solution and still allows additional properties (evolvability); so I've updated the schema. BelgianRemittanceInformation:
description: Remittance Information for credit transfers as supported by Belgian banks.
Only one of `unstructured` or `structured` fields should be used.
type: object
properties:
unstructured:
$ref: "#/components/schemas/BelgianRemittanceInformationUnstructured"
structured:
$ref: "#/components/schemas/BelgianRemittanceInformationStructured"
oneOf:
- required: [unstructured]
- required: [structured] |
reviewed during both functional and technical WGs, so merging and releasing. Version using oneOf is only in available for OpenAPI 3.0, the Swagger 2.0 version has to fall back to minProperties/maxProperties |
awaits validation of vocabularies: belgif/fedvoc#25