-
-
Notifications
You must be signed in to change notification settings - Fork 540
TypeError: Cannot convert undefined or null to object #360
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
Bug seems to be that we do not handle the I think we should make a hardcoded list of all http methods and iterate through them. Would you like to attempt sending a pull request @rendall? I'd start by creating a failing test in |
I'll do this |
A typo in that PR referred to the wrong issue, so, closing this manually |
Was getting the same issue in the lastest installation:
Fix: export function getEntries(obj, options) {
if (!obj) {
return [];
} // add this
let entries = Object.entries(obj);
if (options?.alphabetize) {
entries.sort(([a], [b]) => a.localeCompare(b, "en-us", { numeric: true }));
}
if (options?.excludeDeprecated) {
entries = entries.filter(([, v]) => !(v && typeof v === "object" && "deprecated" in v && v.deprecated));
}
return entries;
} |
Summary: TypeError when attempting to convert valid spec
Detail: This spec passes validity tests https://github.com/rendall/simple-comment/blob/master/src/schema/simple-comment-api.json but attempting to convert it yields the following error (with stack trace):
Reproduce:
npx openapi-typescript https://raw.githubusercontent.com/rendall/simple-comment/master/src/schema/simple-comment-api.json --output schema.ts
Expected:
Either conversion or helpful error message
Compliment, pep talk:
It's just great that you all have made this, and I want to congratulate you on making such a useful tool!
The text was updated successfully, but these errors were encountered: