feat(samples): support multipleOf keyword (#8890)

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

Refs #8577
This commit is contained in:
Vladimír Gorej
2023-06-07 11:48:10 +02:00
committed by GitHub
parent 3e81a4f897
commit 68cfe46490
2 changed files with 22 additions and 4 deletions

View File

@@ -1330,6 +1330,18 @@ describe("sampleFromSchema", () => {
expect(sampleFromSchema(definition)).toEqual(expected)
})
it("should handle multipleOf", () => {
const definition = {
type: "number",
minimum: 22,
multipleOf: 3,
}
const expected = 24
expect(sampleFromSchema(definition)).toStrictEqual(expected)
})
it("should handle minLength", () => {
const definition = {
type: "string",