Add: format and unknownFormats

This commit is contained in:
Nicholas Wallace 2024-06-16 00:32:46 +00:00
parent 327ddd8ec5
commit 0a4d24f1b3

View file

@ -217,6 +217,15 @@ class Server {
console.debug(body) console.debug(body)
} }
}, },
formats: [
// Define custom format types for OpenAPI spec
{
name: 'uuid',
type: 'string',
validate: (v) => /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(v.toString())
}
],
unknownFormats: ['li_[a-z0-9]{18}', '[0-9]*'],
ignoreUndocumented: true ignoreUndocumented: true
}) })
) )