UNPKG

fluid-oas

Version:

Build declarative OpenApiv3.* specifications.

15 lines (14 loc) 511 B
import { withPattern, withMaxLength, withMinLength, withFormat, } from "../common"; import { SchemaBase } from "../lib/base"; const StringBase = withPattern(withMaxLength(withMinLength(withFormat((SchemaBase))()))); class _OpenApiString extends StringBase { toJSON() { const json = super.toJSON(); Object.defineProperty(json, "type", { value: "string", enumerable: true }); return json; } } /** * Creates a OpenAPI String Schema. */ export const String = new _OpenApiString();