Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add HTTP 400 Bad Request as a possible generic error response#1165

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sliverc merged 1 commit intodjango-json-api:mainfromarttuperala:openapi-400-bad-request
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,6 +14,7 @@ any parts of the framework not mentioned in the documentation should generally b

* Added support for Python 3.11.
* Added support for Django 4.2.
* Added `400 Bad Request` as a possible error response in the OpenAPI schema.

### Changed

Expand Down
60 changes: 60 additions & 0 deletionsexample/tests/__snapshots__/test_openapi.ambr
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,6 +38,16 @@
"204": {
"description": "[no content](https://jsonapi.org/format/#crud-deleting-responses-204)"
},
"400": {
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/failure"
}
}
},
"description": "bad request"
},
"401": {
"content": {
"application/vnd.api+json": {
Expand DownExpand Up@@ -204,6 +214,16 @@
},
"description": "update/authors/{id}"
},
"400": {
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/failure"
}
}
},
"description": "bad request"
},
"401": {
"content": {
"application/vnd.api+json": {
Expand DownExpand Up@@ -349,6 +369,16 @@
},
"description": "retrieve/authors/{id}/"
},
"400": {
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/failure"
}
}
},
"description": "bad request"
},
"401": {
"content": {
"application/vnd.api+json": {
Expand DownExpand Up@@ -486,6 +516,16 @@
},
"description": "List/authors/"
},
"400": {
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/failure"
}
}
},
"description": "bad request"
},
"401": {
"content": {
"application/vnd.api+json": {
Expand DownExpand Up@@ -664,6 +704,16 @@
"204": {
"description": "[Created](https://jsonapi.org/format/#crud-creating-responses-204) with the supplied `id`. No other changes from what was POSTed."
},
"400": {
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/failure"
}
}
},
"description": "bad request"
},
"401": {
"content": {
"application/vnd.api+json": {
Expand DownExpand Up@@ -1231,6 +1281,16 @@
},
"description": "List/authors/"
},
"400": {
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/failure"
}
}
},
"description": "bad request"
},
"401": {
"content": {
"application/vnd.api+json": {
Expand Down
1 change: 1 addition & 0 deletionsrest_framework_json_api/schemas/openapi.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -779,6 +779,7 @@ def _add_generic_failure_responses(self, operation):
Add generic failure response(s) to operation
"""
for code, reason in [
("400", "bad request"),
("401", "not authorized"),
]:
operation["responses"][code] = self._failure_response(reason)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp