我正在使用 swagger 为我的 Spring Rest API 项目之一创建 API 文档,但是创建的 swagger.json 文件存在问题。我的超级课程之一没有正确转换。
用于实现招摇的库是springfox。请在下面找到实施细节。
配置 EnableWebMvc EnableSwagger2 ComponentScan
public class MvcConfig extends WebMvcConfigurerAdapter {
}
这是导致问题的类
public class ListResultModel MODEL extends BaseModel {
}
创建的 Json
"schema":{"$ref":"#/definitions/RedirectAttributes"}}],"responses":{"200":{"description":"OK","schema":{"type":"string"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/admin/migration/vat":{"get":{"tags":["migration-controller"],"summary":"vatMigration","operationId":"vatMigrationUsingGET","consumes":["application/json"],"produces":["/"],"parameters":[{"name":"retailerId","in":"query","description":"retailerId","required":true,"type":"string"}
{"$ref":"#/definitions/**ListResultModel«Item»"**}},"401":{"description":""},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/items/withoutPictures/{departmentId}/{vendorId}/{status}":{"200":{"description":"OK","schema":{"$ref":"#/definitions/**ListResultModel«Item»"}**},"401":{"description":""},"403":{"description":"Forbidden"},"404":{"description":"Not }
{"$ref":"#/definitions/ListResultModel«Lead»"}},"201":{"description":"Created"},"401":{"description":""},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}
我试图解决这个问题很长时间,但不知道该怎么做。任何人都可以帮助我吗?
提前致谢。维韦克