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

feat: Introduce @requestBody.file and @oas.response.file decorators #4882

Merged
merged 4 commits into from
Mar 16, 2020

Conversation

raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Mar 13, 2020

This PR introduces two sugar openapi decorators to further simplify configuration of file upload/download.

  • @requestBody.file - configure the request body for file upload
  • @oas.response.file - configure the response for file download

The file upload/download example is now simplified with these decorators.

A new page is added under Usage Scenarios to cover file upload/download.

Fixes #1873

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly look good 👍

@raymondfeng raymondfeng force-pushed the openapi-file-decorators branch 2 times, most recently from faf0c04 to b94a29b Compare March 13, 2020 19:04
@raymondfeng raymondfeng requested a review from jannyHou March 13, 2020 19:07
@@ -357,6 +357,25 @@ class MyController {
}
```

#### @requestBody.file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#### Using @requestBody.file ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other titles don't have Using

Copy link
Contributor

@emonddr emonddr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny typo to fix. Cool stuff!

@raymondfeng raymondfeng force-pushed the openapi-file-decorators branch from b94a29b to a6088a6 Compare March 16, 2020 20:43
@raymondfeng raymondfeng merged commit 0444120 into master Mar 16, 2020
@raymondfeng raymondfeng deleted the openapi-file-decorators branch March 16, 2020 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File upload with multipart/form-data
5 participants