diff --git a/package.json b/package.json index 47e78d01..f215ef17 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ }, "dependencies": { "aspida": "^0.22.2", + "openapi-types": "^7.0.1", "swagger-parser": "^10.0.2", "swagger2openapi": "^7.0.3" }, diff --git a/src/builderUtils/converters.ts b/src/builderUtils/converters.ts index a7f60080..16732686 100644 --- a/src/builderUtils/converters.ts +++ b/src/builderUtils/converters.ts @@ -121,7 +121,7 @@ export const schema2value = ( null: 'null', string: 'string', boolean: 'boolean' - }[schema.type] + }[schema.type ?? 'string'] } return value ? { isArray, isEnum, isOneOf, value } : null diff --git a/yarn.lock b/yarn.lock index 98f2b5a5..8d75226f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4232,6 +4232,11 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" +openapi-types@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-7.0.1.tgz#966bcacfd14119fa12000dbc9d588bfd8df2e4d1" + integrity sha512-6pi4/Fw+JIW1HHda2Ij7LRJ5QJ8f6YzaXnsRA6m44BJz8nLq/j5gVFzPBKJo+uOFhAeHqZC/3uzhTpYPga3Q/A== + optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"