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 respostas
  1. Anurag Sharma (Nagarro) Forum Ambassador
    12 de mar. de 2022, 19:44

    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