Comments (3)
You can still add extra arguments to your request handlers and decorate those with NestJS's own decorators. Extending the ControllerShape
only restricts your return types but you can use any combination or order of arguments (or even none at all, but that would cause a runtime error)
async getPost(
@ApiDecorator() { params: { id } }: RouteShape['getPost'],
@Req() req: Request
) {}
from ts-rest.
You also don't need to extend the ControllerShape
anymore, see this this documentation https://ts-rest.com/docs/nest#response-return-type-safety.
from ts-rest.
Ah thanks guys this clears a lot up.
from ts-rest.
Related Issues (20)
- Providing header in `extraHeaders` causes TS error of: `Type 'string' is not assignable to type 'undefined'.`
- content-type header is overwritten
- @ts-rest/nest attempting to call an object as a function HOT 2
- Using `z.void` fails to parse empty `req.body`
- Feature request: HEAD requests
- Having `void` responses causes response parsing to fail HOT 1
- ts-rest Middleware called after specific Route HOT 7
- Missing docs for `@ts-rest/serverless`
- Replace `c.noBody()` with `z.void()`/`c.type<void>` for empty request/response body HOT 1
- More detailed error context HOT 2
- Vue Query v5.x.x.x HOT 2
- Add support for multipart/form-data file array
- Export a Zod response schema that matches the request validation error responses HOT 2
- Support multiple content-type responses
- Express contract errors are associated with handlers rather than exact code places HOT 3
- POST example does not work HOT 1
- Boolean query parameter always true HOT 3
- No QueryClient set, use QueryClientProvider to set one HOT 1
- Add support/docs for listenTerminalRoute (SSE) HOT 1
- One contract per route HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-rest.