feat(samples): add support for regex string format (#8891)

This change is specific to JSON Schema 2020-12
and OpenAPI 3.1.0.

Refs #8577
This commit is contained in:
Vladimír Gorej
2023-06-07 12:39:04 +02:00
committed by GitHub
parent c529c9e0c3
commit 8a914926b3
2 changed files with 4 additions and 0 deletions

View File

@@ -71,6 +71,9 @@ describe("sampleFromSchema", () => {
expect(sample({ type: "string", format: "password" })).toStrictEqual(
"********"
)
expect(sample({ type: "string", format: "regex" })).toStrictEqual(
"^[a-z]+$"
)
expect(sample({ type: "number" })).toStrictEqual(0)
expect(sample({ type: "number", format: "float" })).toStrictEqual(0.1)
expect(sample({ type: "number", format: "double" })).toStrictEqual(0.1)