UNPKG

fluid-oas

Version:

Build declarative OpenApiv3.* specifications.

23 lines (22 loc) 526 B
import { SchemaBase } from "../lib/base"; const ConstBase = (SchemaBase); class _OpenApiConst extends ConstBase { _val; constructor(val) { super(); this._val = val; } toJSON() { const json = super.toJSON(); if (this._val) { Object.defineProperty(json, "const", { value: this._val, enumerable: true, }); } return json; } } export const Const = (constant) => { return new _OpenApiConst(constant); };