Skip to main content

I am Designing a RAML and in that RAML I need to validate a field that it should be an email ?

 

I built a regex already but not sure what property i should use in RAML to use regex validation.

2 answers
  1. Anurag Sharma (Nagarro) Forum Ambassador
    Mar 12, 2022, 7:44 PM

    Hello,

     

    to use regex in RAML you have to use a poperty - "pattern". Look at the below example

    fieldName:

    displayName: fieldName

    type: string

    pattern: ^[a-zA-Z0-9]*$

    here filedName is type of String with a validation (alphanumeric) using regex. same way you can give regex for email.

0/9000