@@ -123,9 +123,84 @@ export type WrappedRouter<Spec extends ApiSpec> = Omit<
123
123
put : AddRouteHandler < Spec , 'put' > ;
124
124
delete : AddRouteHandler < Spec , 'delete' > ;
125
125
patch : AddRouteHandler < Spec , 'patch' > ;
126
+ /**
127
+ * This function will create a GET route without validating the request, or encoding the response body.
128
+ * However, it will still try decode the request and set `req.decoded: Either<DecodedRequest, Error>`. To see the
129
+ * result of this operation, you can check `req.decoded` in your route handler like this:
130
+ *
131
+ * ```typescript
132
+ * import * as E from 'fp-ts/Either';
133
+ *
134
+ * if (E.isLeft(req.decoded)) {
135
+ * // input validation failed
136
+ * } else {
137
+ * // input validation succeeded
138
+ * }
139
+ * ```
140
+ */
126
141
getUnchecked : AddUncheckedRouteHandler < Spec , 'get' > ;
142
+ /**
143
+ * This function will create a POST route without validating the request body, or encoding the response body.
144
+ * However, it will still try decode the request and set `req.decoded: Either<DecodedRequest, Error>`. To see the
145
+ * result of this operation, you can check `req.decoded` in your route handler like this:
146
+ *
147
+ * ```typescript
148
+ * import * as E from 'fp-ts/Either';
149
+ *
150
+ * if (E.isLeft(req.decoded)) {
151
+ * // input validation failed
152
+ * } else {
153
+ * // input validation succeeded
154
+ * }
155
+ * ```
156
+ */
127
157
postUnchecked : AddUncheckedRouteHandler < Spec , 'post' > ;
158
+ /**
159
+ * This function will create a PUT route without validating the request, or encoding the response body.
160
+ * However, it will still try decode the request and set `req.decoded: Either<DecodedRequest, Error>`. To see the
161
+ * result of this operation, you can check `req.decoded` in your route handler like this:
162
+ *
163
+ * ```typescript
164
+ * import * as E from 'fp-ts/Either';
165
+ *
166
+ * if (E.isLeft(req.decoded)) {
167
+ * // input validation failed
168
+ * } else {
169
+ * // input validation succeeded
170
+ * }
171
+ * ```
172
+ */
128
173
putUnchecked : AddUncheckedRouteHandler < Spec , 'put' > ;
174
+ /**
175
+ * This function will create a DELETE route without validating the request, or encoding the response body.
176
+ * However, it will still try decode the request and set `req.decoded: Either<DecodedRequest, Error>`. To see the
177
+ * result of this operation, you can check `req.decoded` in your route handler like this:
178
+ *
179
+ * ```typescript
180
+ * import * as E from 'fp-ts/Either';
181
+ *
182
+ * if (E.isLeft(req.decoded)) {
183
+ * // input validation failed
184
+ * } else {
185
+ * // input validation succeeded
186
+ * }
187
+ * ```
188
+ */
129
189
deleteUnchecked : AddUncheckedRouteHandler < Spec , 'delete' > ;
190
+ /**
191
+ * This function will create a PATCH route without validating the request, or encoding the response body.
192
+ * However, it will still try decode the request and set `req.decoded: Either<DecodedRequest, Error>`. To see the
193
+ * result of this operation, you can check `req.decoded` in your route handler like this:
194
+ *
195
+ * ```typescript
196
+ * import * as E from 'fp-ts/Either';
197
+ *
198
+ * if (E.isLeft(req.decoded)) {
199
+ * // input validation failed
200
+ * } else {
201
+ * // input validation succeeded
202
+ * }
203
+ * ```
204
+ */
130
205
patchUnchecked : AddUncheckedRouteHandler < Spec , 'patch' > ;
131
206
} ;
0 commit comments