UNPKG

@mintlify/validation

Version:

Validates mint.json files

43 lines (42 loc) 916 B
export class EndpointLocation { constructor(document, path) { var _a; this.document = document; this.endpointPath = path; this.path = ((_a = document.webhooks) === null || _a === void 0 ? void 0 : _a[path]) ? 'webhooks' : 'paths'; this.type = this.path.slice(0, -1); } getEndpointPaths() { return this.document[this.path]; } getEndpoint() { var _a; return (_a = this.document[this.path]) === null || _a === void 0 ? void 0 : _a[this.endpointPath]; } } // Request types export const httpMethods = [ 'get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace', ]; // Schema types export const typeList = [ 'boolean', 'string', 'number', 'integer', 'object', 'array', 'enum<string>', 'enum<number>', 'enum<integer>', 'file', 'null', 'any', ];