feat: added 206 Partial Content to huma responses.

This commit is contained in:
Andrew Orban 2022-04-03 18:19:08 +00:00
parent 8aa6989f4c
commit 82f724a1df
2 changed files with 7 additions and 0 deletions

View file

@ -38,6 +38,11 @@ func NoContent() huma.Response {
return response(http.StatusNoContent)
}
// PartialContent HTTP 206 response
func PartialContent() huma.Response {
return response(http.StatusPartialContent)
}
// MovedPermanently HTTP 301 response.
func MovedPermanently() huma.Response {
return response(http.StatusMovedPermanently)

View file

@ -19,6 +19,7 @@ var funcs = struct {
Created,
Accepted,
NoContent,
PartialContent,
MovedPermanently,
Found,
NotModified,
@ -55,6 +56,7 @@ func TestResponses(t *testing.T) {
http.StatusCreated,
http.StatusAccepted,
http.StatusNoContent,
http.StatusPartialContent,
http.StatusMovedPermanently,
http.StatusFound,
http.StatusNotModified,