Closed larsolofsson closed 2 months ago
We really need to make a working prototype of this technique (I think the properties section needs to be repeated in every anyOf choice. We also need to verify that Swagger Editor shows it properly.
My proposed schema construct works with Swagger Editor, https://editor.swagger.io, to make at least one identifier required for parties and locations.
It didn't work for Patrice at the last meeting, but he was using the New Swagger Editor, https://editor-next.swagger.io, which is only a beta version.
Schema for making at least one identifier required for a party
buyerParty:
type: object
anyOf:
- required:
- id
- required:
- partyIdentifiers
properties:
id:
type: string
format: uuid
partyIdentifiers:
type: array
minItems: 1
items:
type: object
required:
- value
- assignedBy
properties:
value:
type: string
minLength: 1
assignedBy:
type: string
enum:
- Supplier
- Customer
Done, see commit 13f0199.
In current schema all of them are optional. At least one of them should be required. I propose adding the following to parties anyOf:
A propose adding the following to locations anyOf: