Skip to content
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

Merged
merged 7 commits into from
Oct 2, 2023
Merged

Conversation

pvdbosch
Copy link
Contributor

@pvdbosch pvdbosch commented Mar 3, 2023

awaits validation of vocabularies: belgif/fedvoc#25

@pvdbosch
Copy link
Contributor Author

pvdbosch commented Mar 3, 2023

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.

@pvdbosch
Copy link
Contributor Author

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.

@pvdbosch
Copy link
Contributor Author

As alternative to oneOf, add minProperties: 1, maxProperties:1 which also enforces exactly one occurrence.

@pvdbosch pvdbosch changed the title WIP: Belgian Remittance Information Belgian Remittance Information Jun 23, 2023
@pvdbosch
Copy link
Contributor Author

When using oneOf to list only the "required" constraint rather than full object types and properties, I don't find any problems with the generated code anymore.

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]

@pvdbosch
Copy link
Contributor Author

pvdbosch commented Oct 2, 2023

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

@pvdbosch pvdbosch merged commit d891a99 into master Oct 2, 2023
1 check passed
@pvdbosch pvdbosch deleted the feature/remittance-information branch October 2, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant