We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.22.0
2.2.2
18.16.0
macOS
12.6.8
Using FastifyPluginAsyncJsonSchemaToTs along with the shared schema from @fastify/multipart generates a circular type error:
FastifyPluginAsyncJsonSchemaToTs
@fastify/multipart
[TypeScript] src/routes/indexes/index.ts:104:40 - error TS2615: Type of property 'file' circularly references itself in mapped type '{ file: Never; }'. [TypeScript] [TypeScript] 104 const { file } = request.body; [TypeScript] ~~~~~~~~~~~~
import fp from 'fastify-plugin'; import multipart from '@fastify/multipart'; export default fp(async (fastify) => { fastify.register(multipart, { attachFieldsToBody: true, sharedSchemaId: '#multipartField', }); });
import { FastifyPluginAsyncJsonSchemaToTs } from '@fastify/type-provider-json-schema-to-ts'; const root: FastifyPluginAsyncJsonSchemaToTs = async (fastify, opts): Promise<void> => { fastify.post('/upload', { schema: { body: { type: 'object', properties: { file: { $ref: '#multipartField' }, }, required: ['file'], }, } as const, handler: async function (request, reply) { const { file } = request.body; } }); });
No error
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Prerequisites
Fastify version
4.22.0
Plugin version
2.2.2
Node.js version
18.16.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.6.8
Description
Using
FastifyPluginAsyncJsonSchemaToTs
along with the shared schema from@fastify/multipart
generates a circular type error:Steps to Reproduce
@fastify/multipart
in a test project with these options:Expected Behavior
No error
The text was updated successfully, but these errors were encountered: