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
Getting TypeError: schemaObject.required?.includes is not a function when trying to generate types from a json OpenAPI 3.0 spec
joan.gamell@joangamell-MacBook-Pro ~/s/node-sdk (master) [1]> npx openapi-typescript https://docs.moov.io/openapi/openapi.json -o ./lib/_generated-types/types.ts
✨ openapi-typescript 7.4.1
(node:50364) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:292
let optional = schemaObject.required?.includes(k) ||
^
TypeError: schemaObject.required?.includes is not a function
at transformSchemaObjectCore (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:292:55)
at transformSchemaObjectWithComposition (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:112:28)
at transformSchemaObject (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:6:18)
at transformSchemaObjectCore (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:303:23)
at transformSchemaObjectWithComposition (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:112:28)
at transformSchemaObject (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/schema-object.js:6:18)
at transformMediaTypeObject (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/media-type-object.js:7:12)
at transformRequestBodyObject (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/request-body-object.js:15:15)
at transformOperationObject (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/operation-object.js:13:15)
at injectOperationObject (file:///Users/joan.gamell/src/node-sdk/node_modules/openapi-typescript/dist/transform/operation-object.js:38:18)
Node.js v22.1.0
Description
Getting
TypeError: schemaObject.required?.includes is not a function
when trying to generate types from ajson
OpenAPI 3.0 specopenapi-typescript
7.4.1
22.1.0
macOS 14.4.1
Reproduction
npx openapi-typescript https://docs.moov.io/openapi/openapi.json -o ./lib/_generated-types/types.ts
Expected result
No errors, .ts file generated under
lib/_generated-types
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: