在springfox中如何解决“无法解析全局安全范围定义?” >> [

问题描述 投票:5回答:1
我正在使用springfox从spring控制器生成swagger文档。当访问http://127.0.0.1:8080/mycontextroot/swagger-ui.html时,我得到了一个招摇的UI,该UI

有效!

但是当我尝试打开从yaml生成但通过json生成的同一个http://127.0.0.1:8080/mycontextroot/v2/api-docs(或https://editor.swagger.io/)文件时,出现了错误:

enter image description here

昂首阔步:

--- swagger: '2.0' info: description: Api Documentation version: '1.0' title: Api Documentation termsOfService: urn:tos contact: {} license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0 host: 127.0.0.1:8080 basePath: "/" paths: "/mycontextroot/blogs": get: summary: blogs operationId: blogsUsingGET produces: - "*/*" responses: '200': description: OK schema: "$ref": "#/definitions/Blogs" '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - xauth: - global deprecated: false securityDefinitions: xauth: type: apiKey name: my-auth-header in: header definitions: Blog: type: object properties: title: type: string title: Blog Blogs: type: object properties: blogs: type: array items: "$ref": "#/definitions/Blog" title: Blogs

我正在使用springfox从spring控制器生成swagger文档。当访问http://127.0.0.1:8080/mycontextroot/swagger-ui.html时,我得到了工作正常的UI!但是当我尝试打开...
spring spring-boot swagger springfox
1个回答
1
投票
我有同样的问题。无效是由于:
© www.soinside.com 2019 - 2024. All rights reserved.