raml-org / raml-spec

RAML Specification
http://raml.org
3.87k stars 857 forks source link

[Question] How to specify a facet for a nullable type? #757

Open GauthierPLM opened 3 years ago

GauthierPLM commented 3 years ago

I have a type for which I would like to specify that maxLength is 165. However, the type being a nullable string (string | nil), specifying the facet like I did in the example is not authorised (according to Anypoint' Design Center validation).

What is the right way to specify the maxLength?

#%RAML 1.0 DataType
type: object
properties:
  url:
    type: string | nil
    maxLength: 165
    required: false