You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
This is an extension of the closed question: #69
I'm trying to migrate away from the nestjs swagger annotations to using zod instead, which on the whole is working - apart from multipart-form.
So previously I had:
export class ImageClassificationRequest {
@ApiProperty({
enum: availableClassificationModels,
type: String,
description: 'The model to use for image classification'
})
public model!: KnownImageClassificationModel
@ApiProperty({
type: 'string',
format: 'binary'
})
public image!: string
}
In swagger I get a file input:
However if i try and use binary format string with zod:
const binarySchema = extendApi(z.string(), {
format: 'binary'
})
export class ImageClassificationRequest extends createZodDto(
z.strictObject({
model: classificationModelsZodType.describe(
'The model to use for image classification'
),
image: binarySchema.describe('The image to classify')
})
) {}
Swagger just becomes a string:
Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
Hi,
This is an extension of the closed question: #69
I'm trying to migrate away from the
nestjs
swagger annotations to using zod instead, which on the whole is working - apart from multipart-form.So previously I had:
In swagger I get a file input:
However if i try and use binary format string with zod:
Swagger just becomes a string:
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: