You need to use maxProperties according to SPEC: https://swagger.io/docs/specification/v3_0/data-models/data-types/
maxProperties