NoBugBoy / YDoc

充分利用springboot自有注解来对文档进行描述的一款文档生成器。 让我们抛弃大量注解和配置一起拥抱简洁。
Apache License 2.0
82 stars 13 forks source link

离线打印的json无法导入到yapi #6

Closed 401825317 closed 3 years ago

401825317 commented 3 years ago

ydoc: print: true enable: true host: http://yapi.smart-xwork.cn swagger-native: false

导出的json无法导入到yapi {"basePath":"/hrp","definitions":{},"info":{"description":"YDoc生成的RestfulApi文档","title":"YDoc(同时支持SwaggerUi和YApi的一款无侵入api文档生成器)","version":"last"},"paths":{},"schemes":["http"],"swagger":"2.0","tags":[{"description":"loginController","name":"loginController"},{"description":"basicAccountCategoryController","name":"basicAccountCategoryController"},{"description":"basicChargeCategoryController","name":"basicChargeCategoryController"},{"description":"basicChargeItemController","name":"basicChargeItemController"},{"description":"basicDeptMappingController","name":"basicDeptMappingController"},{"description":"basicIncomeItemController","name":"basicIncomeItemController"},{"description":"CABasicAccountItemController","name":"CABasicAccountItemController"},{"description":"CABasicAssetCategoryController","name":"CABasicAssetCategoryController"},{"description":"CABasicAssetItemController","name":"CABasicAssetItemController"},{"description":"CABasicCostClassifyController","name":"CABasicCostClassifyController"},{"description":"CABasicCostItemController","name":"CABasicCostItemController"},{"description":"CABasicMaterialCategoryController","name":"CABasicMaterialCategoryController"},{"description":"CABasicMaterialItemController","name":"CABasicMaterialItemController"},{"description":"CACommonDictionaryController","name":"CACommonDictionaryController"},{"description":"CADataPlatformController","name":"CADataPlatformController"},{"description":"helloController","name":"helloController"},{"description":"basicCitizenshipController","name":"basicCitizenshipController"},{"description":"basicDutyController","name":"basicDutyController"},{"description":"basicDutyLevelController","name":"basicDutyLevelController"},{"description":"basicDutySeriesController","name":"basicDutySeriesController"},{"description":"basicEducationController","name":"basicEducationController"},{"description":"basicEducationDegreeController","name":"basicEducationDegreeController"},{"description":"basicEducationTypeController","name":"basicEducationTypeController"},{"description":"basicPersontypeController","name":"basicPersontypeController"},{"description":"basicPoliticsController","name":"basicPoliticsController"},{"description":"basicPostLevelController","name":"basicPostLevelController"},{"description":"basicPostTypeController","name":"basicPostTypeController"},{"description":"basicPracticeController","name":"basicPracticeController"},{"description":"basicSalaryLevelController","name":"basicSalaryLevelController"},{"description":"basicTitleController","name":"basicTitleController"},{"description":"basicTitleLevelController","name":"basicTitleLevelController"},{"description":"basicTitleSeriesController","name":"basicTitleSeriesController"},{"description":"contractController","name":"contractController"},{"description":"humanCommonDictionaryController","name":"humanCommonDictionaryController"},{"description":"humanLeaveApplyController","name":"humanLeaveApplyController"},{"description":"personChangeController","name":"personChangeController"},{"description":"personRetireController","name":"personRetireController"},{"description":"staffController","name":"staffController"},{"description":"wagesFormulaController","name":"wagesFormulaController"},{"description":"wagesItemController","name":"wagesItemController"},{"description":"wagesPersonController","name":"wagesPersonController"},{"description":"wagesProcessController","name":"wagesProcessController"},{"description":"wagesProjectController","name":"wagesProjectController"},{"description":"wagesTaxController","name":"wagesTaxController"},{"description":"wagesTaxDetailController","name":"wagesTaxDetailController"},{"description":"accountingSchemeController","name":"accountingSchemeController"},{"description":"basicDepartmentController","name":"basicDepartmentController"},{"description":"basicDepartmentGradeController","name":"basicDepartmentGradeController"},{"description":"basicDepartmentTypeController","name":"basicDepartmentTypeController"},{"description":"basicItemController","name":"basicItemController"},{"description":"basicRbrvsController","name":"basicRbrvsController"},{"description":"basicTargetComputeController","name":"basicTargetComputeController"},{"description":"basicTargetController","name":"basicTargetController"},{"description":"basicWorkerController","name":"basicWorkerController"},{"description":"basicWorkerOwnershipController","name":"basicWorkerOwnershipController"},{"description":"classAttendController","name":"classAttendController"},{"description":"classItemController","name":"classItemController"},{"description":"commonDictionaryController","name":"commonDictionaryController"},{"description":"specialPeriodController","name":"specialPeriodController"},{"description":"computeFormulaController","name":"computeFormulaController"},{"description":"computeFormulaDetailController","name":"computeFormulaDetailController"},{"description":"computeFunctionController","name":"computeFunctionController"},{"description":"computeProcedureController","name":"computeProcedureController"},{"description":"computeSpecialController","name":"computeSpecialController"},{"description":"computeSpecialFormulaController","name":"computeSpecialFormulaController"},{"description":"computeSpecialProcedureController","name":"computeSpecialProcedureController"},{"description":"deptAttributeController","name":"deptAttributeController"},{"description":"deptTargetValueController","name":"deptTargetValueController"},{"description":"deptTypeSchemeController","name":"deptTypeSchemeController"},{"description":"distributeAutonomyItemController","name":"distributeAutonomyItemController"},{"description":"distributeFactorItemController","name":"distributeFactorItemController"},{"description":"distributeFactorRatioController","name":"distributeFactorRatioController"},{"description":"recordDrgController","name":"recordDrgController"},{"description":"standardDeptMappingController","name":"standardDeptMappingController"},{"description":"standardDrgBaController","name":"standardDrgBaController"},{"description":"standardDrgDeptController","name":"standardDrgDeptController"},{"description":"standardDrgWeightController","name":"standardDrgWeightController"},{"description":"standardItemDetailController","name":"standardItemDetailController"},{"description":"standardOperationComputeController","name":"standardOperationComputeController"},{"description":"standardOperationController","name":"standardOperationController"},{"description":"standardOperationCountController","name":"standardOperationCountController"},{"description":"standardOperationDetailController","name":"standardOperationDetailController"},{"description":"standardOperationMappingController","name":"standardOperationMappingController"},{"description":"standardPfController","name":"standardPfController"},{"description":"standardPfTypeController","name":"standardPfTypeController"},{"description":"standardRbrvsController","name":"standardRbrvsController"},{"description":"standardRbrvsTypeController","name":"standardRbrvsTypeController"},{"description":"standardRecordRbrvsController","name":"standardRecordRbrvsController"},{"description":"standardTimeController","name":"standardTimeController"},{"description":"taskControlController","name":"taskControlController"},{"description":"basicMenuController","name":"basicMenuController"},{"description":"basicModuleController","name":"basicModuleController"},{"description":"basicUnitController","name":"basicUnitController"},{"description":"companyController","name":"companyController"},{"description":"customColumnController","name":"customColumnController"},{"description":"departmentAttributeController","name":"departmentAttributeController"},{"description":"departmentClassifyController","name":"departmentClassifyController"},{"description":"departmentController","name":"departmentController"},{"description":"departmentMedinurseController","name":"departmentMedinurseController"},{"description":"departmentSharelevelController","name":"departmentSharelevelController"},{"description":"holidayController","name":"holidayController"},{"description":"parameterController","name":"parameterController"},{"description":"roleInfoController","name":"roleInfoController"},{"description":"roleMenuRightsController","name":"roleMenuRightsController"},{"description":"swapItemController","name":"swapItemController"},{"description":"swapSqlConfController","name":"swapSqlConfController"},{"description":"systemFileDownloadController","name":"systemFileDownloadController"},{"description":"systemFileUploadController","name":"systemFileUploadController"},{"description":"userInfoController","name":"userInfoController"}]}

401825317 commented 3 years ago

我看下了源码 你这个还是基于swagger的注释导出的json。

NoBugBoy commented 3 years ago

我看下了源码 你这个还是基于swagger的注释导出的json。

配置: ydoc.enable=true ydoc.print=true 版本: 1.0.7

首先你如果真的认真看了就知道我仅用了swagger的皮肤而已本身和swagger没关系,除了native模式下

其次我不清楚你这是少写了什么东西,格式不对,连request url和请求方式都没有,下面是我测试时所用的demo项目,打印的json如下:

{"basePath":"/","definitions":{"Fdto.Inner":{"type":"object","properties":{"innerType":{"description":"innerType","type":"string"}}},"User":{"title":"User","type":"object","properties":{"fdto":{"$ref":"#/definitions/Fdto.Inner"},"name":{"description":"名称","type":"string"}}},"Fdto":{"title":"Fdto","type":"object","properties":{"localDateTime":{"description":"创建时间01","type":"string(date-time)"},"set":{"type":"array","items":{"description":"set","type":"integer"}},"aFloat":{"description":"aFloat","type":"number"},"aDouble":{"description":"double","type":"number"},"list":{"type":"array","items":{"type":"object","$ref":"#/definitions/User"}},"longLow":{"description":"longLow","type":"number"},"doubleLow":{"description":"doubleLow","type":"number"},"inners":{"description":"inners","type":"array","items":{"type":"object","$ref":"#/definitions/Fdto.Inner"}},"top":{"description":"身高","type":"number"},"intLow":{"description":"intLow","type":"integer"},"floatLow":{"description":"floatLow","type":"number"},"name":{"description":"姓名","type":"string"},"json":{"$ref":"#/definitions/JSONObject"},"time":{"description":"创建时间","type":"string(date-time)"},"map":{"description":"map","type":"object"},"age":{"description":"年龄","type":"integer"}}}},"info":{"contact":{"email":"daydaynotbug@163.com","name":"NoBugBoy","url":"https://github.com/NoBugBoy/YDoc"},"description":"YDoc生成的RestfulApi文档","termsOfService":"https://github.com/NoBugBoy/YDoc","title":"YDoc(同时支持SwaggerUi和YApi的一款无侵入api文档生成器)","version":"1.0.7"},"paths":{"/a/a":{"get":{"summary":"测试1","description":"测试1","responses":{"200":{"schema":{"type":"object","title":"YDoc","$ref":"#/definitions/Fdto","properties":{"localDateTime":{"description":"创建时间01","type":"string(date-time)"},"set":{"type":"array","items":{"description":"set","type":"integer"}},"aFloat":{"description":"aFloat","type":"number"},"aDouble":{"description":"double","type":"number"},"list":{"type":"array","items":{"type":"object","$ref":"#/definitions/User"}},"longLow":{"description":"longLow","type":"number"},"doubleLow":{"description":"doubleLow","type":"number"},"inners":{"description":"inners","type":"array","items":{"type":"object","$ref":"#/definitions/Fdto.Inner"}},"top":{"description":"身高","type":"number"},"intLow":{"description":"intLow","type":"integer"},"floatLow":{"description":"floatLow","type":"number"},"name":{"description":"姓名","type":"string"},"json":{"$ref":"#/definitions/JSONObject"},"time":{"description":"创建时间","type":"string(date-time)"},"map":{"description":"map","type":"object"},"age":{"description":"年龄","type":"integer"}}},"description":"successful operation"}},"parameters":[{"in":"query","name":"name","description":"姓名","type":"string","required":false}],"tags":["测试"]}},"/a/acca":{"post":{"summary":"测试2","description":"测试2","responses":{"200":{"schema":{"type":"object","title":"YDoc","$ref":"#/definitions/Fdto","properties":{"localDateTime":{"description":"创建时间01","type":"string(date-time)"},"set":{"type":"array","items":{"description":"set","type":"integer"}},"aFloat":{"description":"aFloat","type":"number"},"aDouble":{"description":"double","type":"number"},"list":{"type":"array","items":{"type":"object","$ref":"#/definitions/User"}},"longLow":{"description":"longLow","type":"number"},"doubleLow":{"description":"doubleLow","type":"number"},"inners":{"description":"inners","type":"array","items":{"type":"object","$ref":"#/definitions/Fdto.Inner"}},"top":{"description":"身高","type":"number"},"intLow":{"description":"intLow","type":"integer"},"floatLow":{"description":"floatLow","type":"number"},"name":{"description":"姓名","type":"string"},"json":{"description":"json","properties":{"serialVersionUID":{"description":"serialVersionUID","type":"number"},"DEFAULT_INITIAL_CAPACITY":{"description":"DEFAULT_INITIAL_CAPACITY","type":"integer"},"map":{"description":"map","type":"object"}}},"time":{"description":"创建时间","type":"string(date-time)"},"map":{"description":"map","type":"object"},"age":{"description":"年龄","type":"integer"}}},"description":"successful operation"}},"parameters":[{"schema":{"title":"Fdto","$ref":"#/definitions/Fdto"},"in":"body","name":"Fdto"}],"tags":["测试"],"consumes":["application/json"]}},"/a/get":{"get":{"summary":"获取测试","description":"获取测试","responses":{"200":{"schema":{"type":"string","title":"YDoc","properties":{"String":{"description":"java.lang.String","type":"string"}}},"description":"successful operation"}},"parameters":[{"in":"query","name":"id","description":"id","type":"string","required":false}],"tags":["测试"]}},"/a/accaa":{"post":{"summary":"测试3","description":"测试3","responses":{"200":{"schema":{"type":"object","title":"YDoc","$ref":"#/definitions/User","properties":{"fdto":{"$ref":"#/definitions/Fdto.Inner"},"name":{"description":"名称","type":"string"}}},"description":"successful operation"}},"parameters":[{"schema":{"title":"User","$ref":"#/definitions/User"},"in":"body","name":"User"}],"tags":["测试"],"consumes":["application/json"]}}},"schemes":["http"],"swagger":"2.0","tags":[{"description":"测试","name":"测试"}]}