fluid-oas
Version:
Build declarative OpenApiv3.* specifications.
35 lines (34 loc) • 922 B
TypeScript
import { type SchemaInterface } from "../lib/base";
/**
* Representing a string from JSON schema.
*/
export interface OpenApiString extends SchemaInterface<string> {
/**
* Adds a format to this OpenApiString.
*
* @param val - a format string i.e. "date" or "date-time"
*/
addFormat(val: string): this;
/**
* Validates the string with the minimum length.
*
* @param min - Min length of the string.
*/
addMinLength(min: number): this;
/**
* Validates the string with the maximum length.
*
* @param max - Max length of the string.
*/
addMaxLength(max: number): this;
/**
* Validates the string with a regular expresssion.
*
* @param pattern - Regular expression to validate against.
*/
addPattern(pattern: RegExp): this;
}
/**
* Creates a OpenAPI String Schema.
*/
export declare const String: OpenApiString;