swagger-api / swagger-api/swagger-ui
Help to add example attribute for a file upload using multipart/form-data
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A
- OS: macOS
- Browser: Chrome
- Version: latest
- Method of installation: yarn
- Swagger-UI version: 4.0.0
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Swagger/OpenAPI definition:
openapi: 3.0.0
info:
title: CSV Upload API
description: API for uploading a CSV file with name, age, and grade columns
version: 1.0.0
servers:
- url: https://example.com/api
paths:
/upload:
post:
summary: Upload CSV file
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
csv_file:
type: string
format: binary
description: The CSV file to upload
required:
- csv_file
encoding:
csv_file:
contentType: text/csv
example: |
name,age,grade
John Doe,30,85
Jane Smith,25,90
responses:
'200':
description: Successfully uploaded CSV file
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: A success message
data:
type: object
description: Uploaded file metadata
properties:
filename:
type: string
description: The name of the uploaded file
mimetype:
type: string
description: The MIME type of the uploaded file
size:
type: integer
description: The size of the uploaded file in bytes
Screenshots
Swagger Editor:

Request parameters:

How can we help?
Hey team, I'm trying to add an "example" attribute showing the file content of a multipart/form-data request (the csv format), example:
name,age,grade
John Doe,30,85
Jane Smith,25,90
I failed several times until now. I tried to use the Swagger Editor to find a way to do that, but didn't work out.
Can you please show an example of how to do it?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository file, test, or entry point. Start by checking how Swagger UI 4.0.0 handles the OpenAPI 3.0 multipart/form-data example; done means documenting a supported example or clearly explaining the limitation.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100