Validation libs:
- https://github.com/colinhacks/zod
- https://github.com/sinclairzx81/typebox (https://github.com/spacebudz/lucid/blob/9986d0532334c465bbe4aa00234968edb43575d6/src/plutus/data.ts)
See also:
trpc
FAQ:
- How to serve generated openApiDocument generated by generateOpenApiDocument. See https://www.npmjs.com/package/swagger-ui-express.
pnpm run build
results with Error:
node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/trpc-openapi/dist/adapters/aws-lambda.d.ts:2:46 - error TS2307: Cannot find module 'aws-lambda' or its corresponding type declarations.
2 import type { Context as APIGWContext } from 'aws-lambda';
~~~~~~~~~~~~
node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/trpc-openapi/dist/adapters/fastify.d.ts:2:33 - error TS2307: Cannot find module 'fastify' or its corresponding type declarations.
2 import { FastifyInstance } from 'fastify';
~~~~~~~~~
node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/trpc-openapi/dist/adapters/next.d.ts:1:49 - error TS2307: Cannot find module 'next' or its corresponding type declarations.
1 import { NextApiRequest, NextApiResponse } from 'next';
Problem with trpc-openapi
library and solution is to include skipLibCheck": true
info tsconfig.json
. https://stackoverflow.com/a/65136209/1189832
Solution: wclr/ts-node-dev#314
Use this instead of ts-node-dev: ts-node --experimental-specifier-resolution=node --esm ./src/index.ts
.