Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
Describa el tipo de respuesta application/pdf en openapi-generator-cli

Tengo un punto final de API, que devuelve un archivo pdf. Tratando de describir algo como esto:

 /SupportingDocument/document/{documentId}: get: tags: [Company, Document] operationId: getDocument summary: Get document by id security: - JWTAuth: [] parameters: - in: path name: documentId required: true schema: { type: string } responses: 200: description: A PDF file content: application/pdf: schema: type: string format: binary 404: { $ref: '#/components/responses/InternalServerError' } 500: { $ref: '#/components/responses/InternalServerError' }

Pero el generador termina con

 ... return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); // trying to return json, but this is pdf file starting from "%...." } else { throw response; } });

Y luego recibo un error como "Porcentaje de token inesperado en la posición 0...". ¿Cómo puedo describirlo bien?

UPD: Necesito que funcione algo como esto:

 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; // just response, not json } else { throw response; } });
over 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!