Is this correct server function signature to response a file?
Closed this issue · 3 comments
NeroBlackstone commented
For download.yaml
:
paths:
/report:
get:
summary: Returns the report in the PDF format
responses:
'200':
description: A PDF file
content:
application/pdf:
schema:
type: string
format: binary
Julia server generate doc is:
@doc raw"""
Encapsulates generated server code for DownloadServer
The following server methods must be implemented:
- **report_get**
- *invocation:* GET /report
- *signature:* report_get(req::HTTP.Request;) -> String
"""
report_get(req::HTTP.Request;) -> String
, is this the expected result?
NeroBlackstone commented
Another question is how to implement this report_get
function.
Shall we manually set the content-type for response in server implementation?
I think this part is not finished because I can't find any code snip about "application/pdf" in server-generated code.
tanmaykm commented
There have been some related changes to code generation in the openapi-generator
repo... so if you try the master branch of openapi-generator, it should generate report_get(req::HTTP.Request;) -> Vector{UInt8}
instead.