Open glinton opened 4 years ago
application/octet-stream
is another, more common, content type that oats doesn't support as a request body.
Given the following swagger:
openapi: "3.0.0"
info:
title: Stuff service
version: 0.0.0
servers:
- url: ""
paths:
/stuff:
post:
operationId: createStuff
requestBody:
description: thing
content:
application/octet-stream:
schema:
type: string
responses:
'204':
description: No content
This error is returned:
/src/node_modules/@influxdata/oats/dist/generate.js:91
return { description, required, mediaType: textEntry[0], type: "any" };
^
TypeError: Cannot read property '0' of undefined
at Generator.collectBodyParam (/src/node_modules/@influxdata/oats/dist/generate.js:91:65)
at Generator.registerPathOperation (/src/node_modules/@influxdata/oats/dist/generate.js:40:29)
at new Generator (/src/node_modules/@influxdata/oats/dist/generate.js:24:26)
at generate (/src/node_modules/@influxdata/oats/dist/generate.js:219:23)
at async Command.<anonymous> (/src/node_modules/@influxdata/oats/bin/oats:7:18)
given the following section of a swagger file:
I get the following error when generating a client:
lines 89-92 of
generate.js
are as follows:The resolution was to change the content from
application/vnd.influxql
totext/plain
and add a header parameter