나는 Swagger 도구에서 최신 버전입니다. Restfull 응용 프로그램을 swagger 편집기으로 테스트 해 봅니다. 기본 인증을 사용하여 웹 서비스에 액세스했습니다. 자신감-UI에서Swagger Editor : 오류 서버를 찾을 수 없거나 오류가 발생했습니다.
, 미리보기, 즉 콘텐츠 형식을 올바른 같습니다 application/json
를 내가 서버에 자신감 편집기에서 GET 요청을 보낼 때 JSON이 퍼질에, 오류가 발생했습니다.
ERROR Server not found or an error occurred
내 자신감
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore (Simple)",
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
"termsOfService": "http://helloreverb.com/terms/",
"contact": {
"name": "Swagger API team",
"email": "[email protected]",
"url": "http://avfg.com"
},
"license": {
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
},
"host": "127.0.0.1:8xxx",
"basePath": "/v1",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/facedetect/{username}/{albumname}/{imagename}": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"operationId": "findPets",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "username",
"in": "path",
"description": "tags to filter by",
"required": true,
"type": "string"
},
{
"name": "albumname",
"in": "path",
"description": "maximum number of results to return",
"required": true,
"type": "string"
},
{
"name": "imagename",
"in": "path",
"description": "maximum number of results to return",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/pet"
}
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/errorModel"
}
}
}
}
}
},
"definitions": {
"pet": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"errorModel": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}
제발 도와주세요.
미리 감사드립니다.
서버가 사용자가 구성한 것에 응답한다고 가정합니다. http://127.0.0.1:8610/api/v1? – fehguy