@sleekify/sleekify
Version:
A TypeScript decorator driven approach for developing web applications.
27 lines (26 loc) • 1.36 kB
TypeScript
import { type PathItemObject as Source } from '../types/types';
type PathItemObject = {
path: string;
} & Omit<Source, 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace'>;
/**
* You may apply this decorator to your resource class to annotate the class
* with a Uniform Resource Identifier (URI) and an optional OpenAPI path item
* object. Requests will be directed to your resource class when both the
* request path matches the URI and the request HTTP method matches an HTTP
* method decorator applied to one of your class's methods.
*
* Your path must be a full relative path which omits the URI's scheme,
* authority, port, query, and fragment. You may also include template
* expressions, delimited by curly braces ({}), to mark that a section of the
* path is replaceable by a path parameter value.
*
* If you provide an OpenAPI path item object to document your resource class,
* then it must include an extra "path" property to provide the URI. Your
* path item object can't include OpenAPI operation objects since that
* documentation is provided by HTTP method decorators applied to your class's
* methods.
*
* @param pathItemObject The path or an optional OpenAPI path item object definition
*/
export declare function Path(pathItemObject: string | PathItemObject): (target: object) => void;
export {};