-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated examples are not valid when using regular expression patterns #2312
Comments
Hi @albertored Is there a chance you could provide us with additional details regarding this matter along with the minimal setup to replicate it from our side? |
Take this OA as an example: openapi: 3.0.3
info:
version: 1.0.0
title: Test
description: Test
servers:
- url: "/api/1"
paths:
/test:
get:
operationId: Test
summary: Test
description: Test
responses:
"200":
description: Test
content:
application/json:
schema:
type: object
properties:
test:
type: string
pattern: "^[0-9]{5,8}$"
This is rendered like this As you can see the example is rendered as I was planning to open a PR on the https://github.com/Redocly/openapi-sampler repository for generating examples using
so I stop 😄 |
Thank you for the details provided. Let us check it, please. |
Hi @albertored |
Hi @albertored, thanks for the issue. OpenAPI sampler does not support it for now, but I believe may. We'll discuss it. |
Generated examples are not valid when using regular expression patterns.
In this case, the example is simply
"string"
without honoring the regular expression.Maybe something like https://github.com/fent/randexp.js can be used for this
The text was updated successfully, but these errors were encountered: