MCPcopy
hub / github.com/ecyrbe/zodios / ZodiosEndpointDefinition

Interface ZodiosEndpointDefinition

src/zodios.types.ts:654–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652 * Zodios enpoint definition that should be used to create a new instance of Zodios
653 */
654export interface ZodiosEndpointDefinition<R = unknown> {
655 /**
656 * http method : get, post, put, patch, delete
657 */
658 method: Method;
659 /**
660 * path of the endpoint
661 * @example
662 * ```text
663 * /posts/:postId/comments/:commentId
664 * ```
665 */
666 path: string;
667 /**
668 * optional alias to call the endpoint easily
669 * @example
670 * ```text
671 * getPostComments
672 * ```
673 */
674 alias?: string;
675 /**
676 * optional description of the endpoint
677 */
678 description?: string;
679 /**
680 * optional request format of the endpoint: json, form-data, form-url, binary, text
681 */
682 requestFormat?: RequestFormat;
683 /**
684 * optionally mark the endpoint as immutable to allow zodios to cache the response with react-query
685 * use it to mark a 'post' endpoint as immutable
686 */
687 immutable?: boolean;
688 /**
689 * optional parameters of the endpoint
690 */
691 parameters?: Array<ZodiosEndpointParameter>;
692 /**
693 * response of the endpoint
694 * you can use zod `transform` to transform the value of the response before returning it
695 */
696 response: z.ZodType<R>;
697 /**
698 * optional response status of the endpoint for sucess, default is 200
699 * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code
700 */
701 status?: number;
702 /**
703 * optional response description of the endpoint
704 */
705 responseDescription?: string;
706 /**
707 * optional errors of the endpoint - only usefull when using @zodios/express
708 */
709 errors?: Array<ZodiosEndpointError>;
710}
711

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected