You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just upgraded to OAS Tools v3 and immediately noticed that our responses are incorrect.
We are expecting JSON objects but now we are getting escaped strings.
For example, a response in OAS Tools v2 looked like (including headers):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I just upgraded to OAS Tools v3 and immediately noticed that our responses are incorrect.
We are expecting JSON objects but now we are getting escaped strings.
For example, a response in OAS Tools v2 looked like (including headers):
{"name":"@brockdub/push-notification","version":"0.0.0"}
Content-Security-Policy: default-src 'none';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'none';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Type: application/json; charset=utf-8
Content-Length: 59
Date: Tue, 30 May 2023 15:42:45 GMT
Connection: keep-alive
Keep-Alive: timeout=5
And now in OAS Tools v3:
"{\"name\":\"@brockdub/push-notification\",\"version\":\"0.0.0\"}"
Content-Security-Policy: default-src 'none';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'none';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Type: application/json; charset=utf-8
Content-Length: 69
Date: Tue, 30 May 2023 15:52:45 GMT
Connection: keep-alive
Keep-Alive: timeout=5
These were the options I was using in v2:
const options = {
checkControllers: false,
strict: true,
validator: true,
router: false,
customLogger: logger,
docs: {
apiDocs: "/docs",
apiDocsPrefix: apiRootPath,
swaggerUi: "/api-docs",
swaggerUiPrefix: ""
}
};
And these are the options I'm using in v3, which has the file path addition and package.json addition:
const options = {
oasFile: oasFilePath,
packageJSON: path.resolve(__dirname, "../package.json"),
middleware: {
router: { disable: true }
},
checkControllers: false,
strict: true,
validator: true,
router: false,
customLogger: logger,
docs: {
apiDocs: "/docs",
apiDocsPrefix: apiRootPath,
swaggerUi: "/api-docs",
swaggerUiPrefix: ""
}
};
Nothing else has changed, haven't touched the specs or schemas, so I'm not sure if I'm missing something that's possibly so simple I'm not seeing it?
Any help and/or guidance is much appreciated.
Thank you all so much.
Beta Was this translation helpful? Give feedback.
All reactions