Skip to content
New issue

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

[BUG] MultipartFile doesn't show file input in Swagger #2742

Closed
thomaskoeppe opened this issue Jul 2, 2024 · 1 comment
Closed

[BUG] MultipartFile doesn't show file input in Swagger #2742

thomaskoeppe opened this issue Jul 2, 2024 · 1 comment
Assignees
Labels

Comments

@thomaskoeppe
Copy link

Describe the bug

Swagger doesn't show a file input for MultipartFile

image

To Reproduce

  1. Add new Post Controller
  2. Add MultipartFile as param
  3. Start server and open swagger doc

Expected behavior

Swagger should display a file upload input field

Code snippets

import { PathParams} from "@tsed/platform-params";
import { Post, Summary } from "@tsed/schema";
import { Controller } from "@tsed/di";
import { InventoryModel } from "../../models/model.inventory";
import { MultipartFile, PlatformMulterFile } from "@tsed/common";

@Controller("/inventory")
export class Inventory {
  constructor(private readonly calendarService: CalendarService) {}

  @Post("/:hostname")
  @Summary("Upload a file")
  async upload(@PathParams("hostname") hostname: string, @MultipartFile("file") file: PlatformMulterFile) {
    console.log(hostname, file);
  }
}

Repository URL example

No response

OS

Windows

Node version

Node v20.9.0

Library version

v7.74.1

Additional context

image

Copy link

github-actions bot commented Jul 2, 2024

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants