new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

FastAPI · Advanced · all subjects

additional responses/media types

2 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Additional media types for main response

The responses parameter can add different media types for the same response status code. For example, you can declare that a path operation returns either application/json or image/png by specifying both media types in the responses dict.

Default media type handling in responses

Unless specified differently in the responses parameter, FastAPI assumes additional responses have the same media type as the main response class (default is application/json). If a custom response class has None as its media type, FastAPI will use application/json for any additional response with an associated model.

Give your agent this brain