huajiayi / openapi-tool

:rocket:A tool to generate JavaScript or TypeScript code automatically based on Swagger/OpenAPI specifications
MIT License
41 stars 11 forks source link

TypeError: Cannot read property 'schema' of undefined #7

Closed JayTam closed 1 month ago

JayTam commented 1 year ago
(node:18807) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'schema' of undefined
    at parseOperation (/Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:196:41)
    at /Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:246:13
    at Array.forEach (<anonymous>)
    at getApis (/Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:240:23)
    at spec3ToOpenApi (/Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:308:18)
    at getOpenApi (/Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:316:16)
    at OpenApiTool.getOpenApi (/Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:408:16)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async OpenApiTool.generateService (/Users/jaytam/ShenzhouProjects/asset-valuation-web/node_modules/.pnpm/openapi-tool@0.4.1/node_modules/openapi-tool/dist/main.js:411:25)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:18807) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:18807) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{"openapi":"3.0.3","info":{"title":"资源中心swagger业务","description":"不需要描述","contact":{"name":"clc","url":"http://www.baidu.com","email":"clc@x.com"},"version":"1.0"},"servers":[{"url":"http://localhost:8080","description":"Inferred Url"}],"tags":[{"name":"house-trade-base-data-controller","description":"House Trade Base Data Controller"},{"name":"permission-controller","description":"Permission Controller"},{"name":"role-controller","description":"Role Controller"},{"name":"scheduled-controller","description":"Scheduled Controller"},{"name":"user-controller","description":"User Controller"},{"name":"字典类型"},{"name":"房产估价","description":"房产估价"},{"name":"楼盘","description":"楼盘"}],"paths":{"/api/evaluate/quick":{"post":{"tags":["asset-evaluate-controller"],"summary":"quickEvaluate","operationId":"quickEvaluateUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickEvaluateQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"number","format":"double"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/building/delete":{"post":{"tags":["building-controller"],"summary":"deleteBuilding","operationId":"deleteBuildingUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/building/detail":{"post":{"tags":["building-controller"],"summary":"getBuilding","operationId":"getBuildingUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Building"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/building/list":{"post":{"tags":["building-controller"],"summary":"getBuildingList","operationId":"getBuildingListUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildingListQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommonPage«Building»"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/building/save":{"post":{"tags":["building-controller"],"summary":"saveBuilding","operationId":"saveBuildingUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/building/update":{"post":{"tags":["building-controller"],"summary":"updateBuilding","operationId":"updateBuildingUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/dictType/all":{"post":{"tags":["dict-type-controller"],"summary":"dictTypeAll","operationId":"dictTypeAllUsingPOST","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result«List«DictTypeVo»»"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/dictType/create":{"post":{"tags":["dict-type-controller"],"summary":"createDictType","operationId":"createDictTypeUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DictType"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result«DictType»"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/dictType/delete":{"post":{"tags":["dict-type-controller"],"summary":"deleteDictType","operationId":"deleteDictTypeUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DictType"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/dictType/detail":{"post":{"tags":["dict-type-controller"],"summary":"dictTypeDetail","operationId":"dictTypeDetailUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DictDetailQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DictTypeVo"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/dictType/list":{"post":{"tags":["dict-type-controller"],"summary":"dictTypeList","operationId":"dictTypeListUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseListQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommonPage«DictType»"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/dictType/update":{"post":{"tags":["dict-type-controller"],"summary":"updateDictType","operationId":"updateDictTypeUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DictTypeUpdateQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/houseTradeBaseData/list":{"post":{"tags":["house-trade-base-data-controller"],"summary":"getHouseTradeList","operationId":"getHouseTradeListUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseListQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommonPage«HouseTradeBaseData»"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/permission/getMenu":{"get":{"tags":["permission-controller"],"summary":"getMenu","operationId":"getMenuUsingGET","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MenuTreeVo"}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/permission/saveMenu":{"post":{"tags":["permission-controller"],"summary":"saveMenu","operationId":"saveMenuUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Permission"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/role/addOrUpdateRoleMenu":{"post":{"tags":["role-controller"],"summary":"addOrUpdateRoleMenu","operationId":"addOrUpdateRoleMenuUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleMenuSaveQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/role/delete":{"delete":{"tags":["role-controller"],"summary":"delete","operationId":"deleteUsingDELETE","parameters":[{"name":"id","in":"query","description":"id","required":true,"style":"form","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"204":{"description":"No Content"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/api/role/list":{"post":{"tags":["role-controller"],"summary":"list","operationId":"listUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Role"}}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/role/save":{"post":{"tags":["role-controller"],"summary":"saveRole","operationId":"saveRoleUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleSaveQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/role/update":{"post":{"tags":["role-controller"],"summary":"updateRole","operationId":"updateRoleUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleSaveQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/scheduled/star":{"post":{"tags":["scheduled-controller"],"summary":"star","operationId":"starUsingPOST","responses":{"200":{"description":"OK"},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/scheduled/starCleanAJK":{"post":{"tags":["scheduled-controller"],"summary":"starCleanAJK","operationId":"starCleanAJKUsingPOST","responses":{"200":{"description":"OK"},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/scheduled/starCleanBK":{"post":{"tags":["scheduled-controller"],"summary":"starCleanBK","operationId":"starCleanBKUsingPOST","responses":{"200":{"description":"OK"},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/scheduled/starCleanBKListing":{"post":{"tags":["scheduled-controller"],"summary":"starCleanBKListing","operationId":"starCleanBKListingUsingPOST","responses":{"200":{"description":"OK"},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/scheduled/starCleanBKTransaction":{"post":{"tags":["scheduled-controller"],"summary":"starCleanBKTransaction","operationId":"starCleanBKTransactionUsingPOST","responses":{"200":{"description":"OK"},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/user/info":{"get":{"tags":["user-controller"],"summary":"userInfo","operationId":"userInfoUsingGET","parameters":[{"name":"Authorization","in":"header","description":"Authorization","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UserInfoVo"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/user/save":{"post":{"tags":["user-controller"],"summary":"saveUser","operationId":"saveUserUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSaveQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/user/update":{"post":{"tags":["user-controller"],"summary":"update","operationId":"updateUsingPOST","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateQo"}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"boolean"}}}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}},"components":{"schemas":{"BaseListQo":{"title":"BaseListQo","type":"object","properties":{"pageNum":{"type":"integer","description":"当前页码","format":"int32"},"pageSize":{"type":"integer","description":"每页条数","format":"int32"}}},"Building":{"title":"Building","type":"object","properties":{"address":{"type":"string","description":"小区地址"},"area":{"type":"integer","description":"占地面积(m2)","format":"int32"},"buildAt":{"type":"string","description":"建成年份"},"buildType":{"type":"string","description":"建筑类型"},"buildUrl":{"type":"string","description":"楼盘地址url"},"buildingArea":{"type":"integer","description":"总建筑面积(m2)","format":"int32"},"buildingCoverageRatio":{"type":"integer","description":"建筑覆盖率(%)","format":"int32"},"buildingEnum":{"type":"string","description":"楼盘性质 商品房、经济适用房、安置房、还建房、集资房、公房"},"buildingNum":{"type":"integer","description":"栋数","format":"int32"},"businessDistrict":{"type":"string","description":"所属商圈"},"city":{"type":"string","description":"市"},"commercialArea":{"type":"integer","description":"商业总面积(m2)","format":"int32"},"createBy":{"type":"string","description":"创建人"},"developers":{"type":"string","description":"开发商"},"greeningRatio":{"type":"object","description":"绿化率(%)"},"heat":{"type":"integer","description":"是否供暖 0否 1是","format":"int32"},"householdNum":{"type":"integer","description":"总户数","format":"int32"},"id":{"type":"integer","format":"int32"},"landArea":{"type":"integer","description":"用地面积(m2)","format":"int32"},"landEndAt":{"type":"string","description":"土地终止时间(年/月/日)","format":"date"},"landGainEnum":{"type":"string","description":"土地获取方式 1:出让 2:划拨"},"landLevel":{"type":"integer","description":"土地级别","format":"int32"},"name":{"type":"string","description":"楼盘名称"},"parkingGarageArea":{"type":"integer","description":"车库总面积(m2)","format":"int32"},"parkingHouseholdRatio":{"type":"integer","description":"车位配比(户均:个/户)(商业:个/100M2)","format":"int32"},"parkingRate":{"type":"string","description":"停车费"},"parkingSpace":{"type":"string","description":"停车位"},"parkingSpaceManagement":{"type":"string","description":"车位管理费"},"parkingSpaceNum":{"type":"integer","description":"车位数量(个)","format":"int32"},"phase":{"type":"string","description":"楼盘期数"},"platform":{"type":"string","description":"平台 链家、安居客、贝壳"},"plotRatio":{"type":"object","description":"容积率"},"propertyCompany":{"type":"string","description":"物管公司"},"propertyManagementFees":{"type":"string","description":"物管费(元/m2.月)"},"propertyRightYear":{"type":"integer","description":"产权年限","format":"int32"},"propertyType":{"type":"string","description":"物业类别 商住楼、别墅、公寓住宅"},"province":{"type":"string","description":"省份"},"region":{"type":"string","description":"区/县"},"residentialArea":{"type":"integer","description":"住宅总面积(m2)","format":"int32"},"supplyWaterPower":{"type":"string","description":"供水供电"},"updateBy":{"type":"string","description":"最后维护人"}}},"BuildingListQo":{"title":"BuildingListQo","type":"object","properties":{"name":{"type":"string","description":"(楼盘/小区)名称"},"pageNum":{"type":"integer","description":"当前页码","format":"int32"},"pageSize":{"type":"integer","description":"每页条数","format":"int32"}}},"CommonPage«Building»":{"title":"CommonPage«Building»","type":"object","properties":{"extraData":{"type":"object"},"list":{"type":"array","items":{"$ref":"#/components/schemas/Building"}},"pageNum":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"}}},"CommonPage«DictType»":{"title":"CommonPage«DictType»","type":"object","properties":{"extraData":{"type":"object"},"list":{"type":"array","items":{"$ref":"#/components/schemas/DictType"}},"pageNum":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"}}},"CommonPage«HouseTradeBaseData»":{"title":"CommonPage«HouseTradeBaseData»","type":"object","properties":{"extraData":{"type":"object"},"list":{"type":"array","items":{"$ref":"#/components/schemas/HouseTradeBaseData"}},"pageNum":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"}}},"DictData":{"title":"DictData","type":"object","properties":{"fixed":{"type":"integer","description":"是否固定(是否可编辑)","format":"int32"},"id":{"type":"integer","format":"int32"},"name":{"type":"string","description":"字典名"},"typeCode":{"type":"string","description":"字典类型ID"},"value":{"type":"string","description":"字典值"}}},"DictDataUpdateQo":{"title":"DictDataUpdateQo","required":["id"],"type":"object","properties":{"fixed":{"type":"integer","format":"int32"},"id":{"type":"integer","format":"int32"},"name":{"type":"string"},"value":{"type":"string"}}},"DictDetailQo":{"title":"DictDetailQo","type":"object","properties":{"code":{"type":"string","description":"字典分类代码"}}},"DictType":{"title":"DictType","type":"object","properties":{"code":{"type":"string","description":"编码"},"id":{"type":"integer","format":"int32"},"name":{"type":"string","description":"字典类型名"}}},"DictTypeUpdateQo":{"title":"DictTypeUpdateQo","type":"object","properties":{"code":{"type":"string","description":"编码"},"id":{"type":"integer","description":"ID","format":"int32"},"list":{"type":"array","description":"字典数据列表","items":{"$ref":"#/components/schemas/DictDataUpdateQo"}},"name":{"type":"string","description":"字典类型名"}}},"DictTypeVo":{"title":"DictTypeVo","type":"object","properties":{"code":{"type":"string","description":"编码"},"id":{"type":"integer","format":"int32"},"list":{"type":"array","items":{"$ref":"#/components/schemas/DictData"}},"name":{"type":"string","description":"字典类型名"}}},"HouseTradeBaseData":{"title":"HouseTradeBaseData","type":"object","properties":{"browseNumber":{"type":"integer","description":"浏览次数","format":"int32"},"buildArea":{"type":"object","description":"建筑面积"},"buildStructure":{"type":"string","description":"建筑结构"},"buildType":{"type":"string","description":"建筑类型"},"buildYear":{"type":"integer","description":"修建年代","format":"int32"},"changePriceNumber":{"type":"integer","description":"调价次数","format":"int32"},"elevator":{"type":"string","description":"有无电梯 0 无 1 有","format":"byte"},"floor":{"type":"integer","description":"所在楼层","format":"int32"},"floorHouseProportion":{"type":"string","description":"梯户比例"},"followNumber":{"type":"integer","description":"关注人数","format":"int32"},"heatType":{"type":"string","description":"供暖方式"},"houseAge":{"type":"string","description":"房屋年限"},"houseDirection":{"type":"string","description":"房屋朝向"},"houseId":{"type":"string","description":"房屋编号"},"houseOwner":{"type":"string","description":"房权归属"},"housePurpose":{"type":"string","description":"房屋用途"},"houseStructure":{"type":"string","description":"户型结构"},"houseType":{"type":"string","description":"房屋户型"},"id":{"type":"integer","format":"int32"},"insideArea":{"type":"object","description":"套内面积"},"listingDate":{"type":"string","description":"挂牌时间","format":"date"},"listingPrice":{"type":"object","description":"挂牌价格(万)"},"projectName":{"type":"string","description":"名称项目名称"},"renovationDetail":{"type":"string","description":"装修情况"},"takeShowNumber":{"type":"integer","description":"带看次数","format":"int32"},"trade":{"type":"integer","description":"成交周期(天)","format":"int32"},"tradeAttribute":{"type":"string","description":"交易权属"},"tradeDate":{"type":"string","description":"交易时间","format":"date"},"tradePrice":{"type":"object","description":"交易总价格(万)"},"tradeType":{"type":"integer","description":"交易类型 1买卖 2出租","format":"int32"},"unitPrice":{"type":"object","description":"单元平方米价格(元/平)"}}},"MenuTreeVo":{"title":"MenuTreeVo","type":"object","properties":{"children":{"type":"array","items":{"$ref":"#/components/schemas/MenuTreeVo"}},"code":{"type":"string"},"detail":{"type":"string"},"id":{"type":"integer","format":"int32"},"label":{"type":"string"},"name":{"type":"string"},"parentId":{"type":"integer","format":"int32"}}},"Permission":{"title":"Permission","type":"object","properties":{"code":{"type":"string","description":"菜单code"},"detail":{"type":"string","description":"描述"},"id":{"type":"integer","format":"int32"},"label":{"type":"string","description":"标签"},"name":{"type":"string","description":"菜单名称"},"parentId":{"type":"integer","description":"父id","format":"int32"}}},"QuickEvaluateQo":{"title":"QuickEvaluateQo","type":"object","properties":{"buildingId":{"type":"integer","format":"int32"},"buildingNum":{"type":"integer","format":"int32"},"floorNum":{"type":"integer","format":"int32"},"floorTotal":{"type":"integer","format":"int32"},"housePurpose":{"type":"integer","format":"int32"},"roomNum":{"type":"integer","format":"int32"},"structureArea":{"type":"number","format":"double"}}},"Result":{"title":"Result","type":"object","properties":{"code":{"type":"integer","format":"int32"},"data":{"type":"object"},"msg":{"type":"string"}}},"Result«DictType»":{"title":"Result«DictType»","type":"object","properties":{"code":{"type":"integer","format":"int32"},"data":{"$ref":"#/components/schemas/DictType"},"msg":{"type":"string"}}},"Result«List«DictTypeVo»»":{"title":"Result«List«DictTypeVo»»","type":"object","properties":{"code":{"type":"integer","format":"int32"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DictTypeVo"}},"msg":{"type":"string"}}},"Role":{"title":"Role","type":"object","properties":{"id":{"type":"integer","format":"int32"},"roleName":{"type":"string","description":"角色名"},"status":{"type":"string","description":"角色状态 1正常 0 禁用","format":"byte"}}},"RoleMenuSaveQo":{"title":"RoleMenuSaveQo","required":["roleId"],"type":"object","properties":{"menuIdList":{"type":"array","items":{"type":"integer","format":"int32"}},"roleId":{"type":"integer","format":"int32"}}},"RoleQo":{"title":"RoleQo","type":"object","properties":{"status":{"type":"string","format":"byte"}}},"RoleSaveQo":{"title":"RoleSaveQo","required":["roleName","status"],"type":"object","properties":{"id":{"type":"integer","format":"int32"},"roleName":{"type":"string"},"status":{"type":"string","format":"byte"}}},"UserInfoVo":{"title":"UserInfoVo","type":"object","properties":{"menuTreeVoList":{"type":"array","items":{"$ref":"#/components/schemas/MenuTreeVo"}},"name":{"type":"string"},"phone":{"type":"string"},"sex":{"type":"integer","format":"int32"},"status":{"type":"integer","format":"int32"},"username":{"type":"string"}}},"UserSaveQo":{"title":"UserSaveQo","required":["name","phone","roleId","username"],"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"roleId":{"type":"integer","format":"int32"},"sex":{"type":"integer","format":"int32"},"username":{"maxLength":18,"minLength":6,"type":"string"}}},"UserUpdateQo":{"title":"UserUpdateQo","required":["name","phone","roleId","username"],"type":"object","properties":{"name":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"roleId":{"type":"integer","format":"int32"},"sex":{"type":"integer","format":"int32"},"userId":{"type":"integer","format":"int32"},"username":{"maxLength":18,"minLength":6,"type":"string"}}}}}}
JayTam commented 1 year ago

错误的原因:

/scheduled/star 接口未定义返回值,seagger 的 json 也没有以下的 content,需要做一下空判断

image

后端接口定义

@RestController
@RequestMapping("/scheduled")
public class ScheduledController {

    @Autowired
    private ScheduledService scheduledService;

    /**
     * 手动开启定时任务
     */
    @PostMapping("/star")
    private void star() {
        scheduledService.star();
    }
}

Swagger JSON

image
JayTam commented 1 year ago

需要修复的代码位置:

https://github.com/huajiayi/openapi-tool/blob/3367f912f35c0171af1875950baa2cbf9575af39/src/openapi.ts#L279-L281