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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user