-
Notifications
You must be signed in to change notification settings - Fork 216
Input not taking JSON as valid data #841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can someone confirm if this package supports esm modules ? |
const examplejson = { Converter.convert( pass your json using JSON.stringify() |
my json has circular dependency so JSON.strinfgify will throw an error but also jSON.stringify returns a string. so although you state the type as json, youre still passing string in the in the data property of input . Importing the package as commonjs allows me to pass a json as data without typescript getting mad at me, but the converter uses JSON.stringify internally when the type is json so the convert doesn't work anyways.. I handled the circular dependency externally using |
Hi @Zino-ctrlZ Suggested Fixes: Ensure the converter library is updated to a version that properly supports Swagger 2.0 via the swagger field. If the issue persists, file a bug report with the library maintainers to address the incorrect validation logic for Swagger 2.0 specs. Alternative Solution with Apyhub: `const apyhub = require("apyhub"); async function convertSpec() { const response = await apyhub.convert("specification", data); convertSpec();` |
Hi, I'm making use of Converter.convert from openapi-to-postmanv2 in typescript running node20. The index.d.ts file has the data property in Input set to string.
i.e in the build file,
so I'm getting an error when trying to pass an object to in in the data property, so the below fails
is there no support for passing data as json in node ?
The text was updated successfully, but these errors were encountered: