Wenn Sie neben dem Hauptstatuscode weitere Statuscodes zurückgeben möchten, können Sie dies tun, indem Sie direkt eine `Response` zurückgeben, wie etwa eine `JSONResponse`, und den zusätzlichen Statuscode direkt festlegen.
Wenn Sie neben dem Hauptstatuscode weitere Statuscodes zurückgeben möchten, können Sie dies tun, indem Sie direkt eine `Response` zurückgeben, wie etwa eine `JSONResponse`, und den zusätzlichen Statuscode direkt festlegen.
@ -156,7 +156,7 @@ Hier ist, was Sie beachten sollten und wie Sie einen Pull Request überprüfen:
* Es besteht auch eine gute Chance, dass der Pull Request nicht wirklich benötigt wird, da das Problem auf **andere Weise** gelöst werden kann. Dann können Sie das vorschlagen oder danach fragen.
* Es besteht auch eine gute Chance, dass der Pull Request nicht wirklich benötigt wird, da das Problem auf **andere Weise** gelöst werden kann. Dann können Sie das vorschlagen oder danach fragen.
### Keine Panik wegen des Stils { #don-t-worry-about-style }
### Keine Panik wegen des Stils { #dont-worry-about-style }
* Machen Sie sich keine Sorgen über Dinge wie den Stil von Commit-Nachrichten. Ich werde den Commit zusammenführen und manuell anpassen.
* Machen Sie sich keine Sorgen über Dinge wie den Stil von Commit-Nachrichten. Ich werde den Commit zusammenführen und manuell anpassen.
@ -237,7 +237,7 @@ Nutzen Sie den Chat nur für andere allgemeine Gespräche.
///
///
### Den Chat nicht für Fragen verwenden { #don-t-use-the-chat-for-questions }
### Den Chat nicht für Fragen verwenden { #dont-use-the-chat-for-questions }
Bedenken Sie, dass Sie in Chats, die „freie Konversation“ erlauben, leicht Fragen stellen können, die zu allgemein und schwer zu beantworten sind, sodass Sie möglicherweise keine Antworten erhalten.
Bedenken Sie, dass Sie in Chats, die „freie Konversation“ erlauben, leicht Fragen stellen können, die zu allgemein und schwer zu beantworten sind, sodass Sie möglicherweise keine Antworten erhalten.
@ -4,7 +4,7 @@ By default, **FastAPI** will return the responses using a `JSONResponse`, puttin
It will use the default status code or the one you set in your *path operation*.
It will use the default status code or the one you set in your *path operation*.
## Additional status codes { #additional-status-codes }
## Additional status codes { #additional-status-codes_1 }
If you want to return additional status codes apart from the main one, you can do that by returning a `Response` directly, like a `JSONResponse`, and set the additional status code directly.
If you want to return additional status codes apart from the main one, you can do that by returning a `Response` directly, like a `JSONResponse`, and set the additional status code directly.
@ -156,7 +156,7 @@ Here's what to keep in mind and how to review a pull request:
* There's also a good chance that the pull request is not actually needed because the problem can be solved in a **different way**. Then you can suggest or ask about that.
* There's also a good chance that the pull request is not actually needed because the problem can be solved in a **different way**. Then you can suggest or ask about that.
### Don't worry about style { #don-t-worry-about-style }
### Don't worry about style { #dont-worry-about-style }
* Don't worry too much about things like commit message styles, I will squash and merge customizing the commit manually.
* Don't worry too much about things like commit message styles, I will squash and merge customizing the commit manually.
@ -237,7 +237,7 @@ Use the chat only for other general conversations.
///
///
### Don't use the chat for questions { #don-t-use-the-chat-for-questions }
### Don't use the chat for questions { #dont-use-the-chat-for-questions }
Keep in mind that as chats allow more "free conversation", it's easy to ask questions that are too general and more difficult to answer, so, you might not receive answers.
Keep in mind that as chats allow more "free conversation", it's easy to ask questions that are too general and more difficult to answer, so, you might not receive answers.
If you want to use the exception along with the same default exception handlers from **FastAPI**, you can import and reuse the default exception handlers from `fastapi.exception_handlers`:
If you want to use the exception along with the same default exception handlers from **FastAPI**, you can import and reuse the default exception handlers from `fastapi.exception_handlers`:
@ -183,7 +183,7 @@ This old OpenAPI-specific `examples` parameter is now `openapi_examples` since F
///
///
### JSON Schema's `examples` field { #json-schema-s-examples-field }
### JSON Schema's `examples` field { #json-schemas-examples-field }
But then JSON Schema added an <ahref="https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5"class="external-link"target="_blank">`examples`</a> field to a new version of the specification.
But then JSON Schema added an <ahref="https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5"class="external-link"target="_blank">`examples`</a> field to a new version of the specification.