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

feature: support default response, use comma-separated codes to add a… #837

Merged
merged 5 commits into from
Nov 20, 2020

Conversation

sdghchj
Copy link
Member

@sdghchj sdghchj commented Nov 19, 2020

Describe the PR

  1. Support default response. Add default response annotation #691 override PR Add support for @default annotation to add a default response type for operations #692
  2. Use comma-separated codes to define the same response for multi-codes in one line.
  3. Use comma-separated codes to add a header for multi responses in one line. Set same response header for multiple return codes #785
  4. Use keyword 'all' to add a header for all responses. Set same response header for multiple return codes #785

Relation issue
#785 #691

// @Success 200 {string} string	"ok"
// @failure 400,401 {string} string	"error"
// @response default {string} string	"other error"
// @Header 200 {string} Location "/entity/1"
// @Header 200,400,default {string} Token "token"
// @Header all {string} Token2 "token2"

@codecov
Copy link

codecov bot commented Nov 20, 2020

Codecov Report

Merging #837 (049f8c9) into master (2ca4d38) will increase coverage by 0.23%.
The diff coverage is 90.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #837      +/-   ##
==========================================
+ Coverage   82.53%   82.76%   +0.23%     
==========================================
  Files           8        8              
  Lines        1626     1642      +16     
==========================================
+ Hits         1342     1359      +17     
+ Misses        168      167       -1     
  Partials      116      116              
Impacted Files Coverage Δ
operation.go 87.78% <90.47%> (+0.57%) ⬆️
parser.go 78.98% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ca4d38...049f8c9. Read the comment docs.

Copy link
Member

@easonlin404 easonlin404 left a comment

Choose a reason for hiding this comment

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

LGTM

@easonlin404
Copy link
Member

@sdghchj Thanks for your big effort on it!

@ubogdan
Copy link
Contributor

ubogdan commented Feb 17, 2021

Hi,
It looks like a broken commit were merged into master and everything is failing now...
Is this a work in progress ???

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

Successfully merging this pull request may close these issues.

3 participants