openapi-spec-validator icon indicating copy to clipboard operation
openapi-spec-validator copied to clipboard

legal regex doesn't validate

Open estimiriam opened this issue 6 years ago • 1 comments

pattern: '^(?i)one|two|three$'

The regex does not validate. (?i) is the issue. It allows case-insensitive pattern match.

It causes this error in swagger-editor:

Structural error at components.schemas.Session.properties.operation.pattern should match format "regex" format: regex

estimiriam avatar Nov 04 '19 21:11 estimiriam

Hi,

I have the same problem with this

contract_id:
  in: header
  description: Identifiant 
  name: contract_id
  required: true
  schema:
    type: string
    pattern: (?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
  example: 5DD440B2-197A-4AB7-B742-11CE25C9F2AB

result :

  Errors
  Hide
   
  Structural error at components.parameters.contract_id.schema.pattern
  should match format "regex"
  format: regex
  Jump to line 908

influence160 avatar Oct 12 '22 10:10 influence160