Pattern property validation in swagger parser
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023
02:39 AM
05-08-2023
02:39 AM
Pattern property validation in swagger parser
Hi Team,
I'm using the Swagger parser for my tooling implementation, and I have a requirement for regex pattern validation since the Swagger specification supports ECMA flavor regex patterns. I would like to have some parser validation errors if we provide an invalid regex pattern to the OpenAPI specification.
ex:
```
openapi:
...
components:
schemas:
Person:
type: object
properties:
name:
type: string
pattern: /(?<!or)ange/g
schemas:
Person:
type: object
properties:
name:
type: string
pattern: /(?<!or)ange/g
...
```
This given pattern is invalid in `/(?<!or)ange/g` in ECMA https://regex101.com/r/jjIQfL/1/ , I'm unable to get those details from the current swagger parser.
Could you please let me know whether there is a way I can get this validation through the Swagger parser?
Labels:
- Labels:
-
Swagger Core
0 REPLIES 0
