ServiceAreaRestriction
Type: object
Properties:
restrictionType:
Reference: '#/components/schemas/RestrictionType'
areas:
Type: array
Items:
Reference: '#/components/schemas/Area'
maxNumOfTAs:
Reference: '#/components/schemas/Uinteger'
allOf:
#
# 1st condition: restrictionType and areas attributes shall be either both absent
# or both present
#
- oneOf:
- not:
Required: [ restrictionType ]
- required: [ areas ]
#
# 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS,
# then maxNumOfTAs shall be absent
#
- anyOf:
- not:
Required: [ restrictionType ]
Properties:
restrictionType:
Type: string
enum: [ NOT_ALLOWED_AREAS ]
- not:
Required: [ maxNumOfTAs ]