-
I have some end points which return either a known content file Does anyone know how this could be done with Ninja? |
Beta Was this translation helpful? Give feedback.
Answered by
vitalik
Mar 14, 2024
Replies: 1 comment 1 reply
-
here is a reference to discussion - #1073 generally for how you can do the following: BIN_RESPONSE = {
"responses": {
200: {
"description": "OK",
"content": {"application/octet-stream": {"schema": {"type": "string", "format": "binary"}}},
}
}
}
@api.get("/hello", openapi_extra=BIN_RESPONSE)
def hello(request):
return HttpResponse(b'hello', content_type='application/octet-stream') |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
stumpylog
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@stumpylog
here is a reference to discussion - #1073
generally for how you can do the following: