2016-10-04 2 views
1

Swagger (http://petstore.swagger.io/v2/swagger.json)에서 PetStore 스키마를 가져 오려고했지만 다음과 같은 오류가 발생했습니다. 여기에서 문제를 이해할 수 있도록 도와 주실 수 있습니까?AWS API 게이트웨이 : Swagger API 스키마 가져 오기 관련 문제

오류 :이를보고

Your API was not imported due to errors in the Swagger file. 
Unable to create model for 'Order': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] 
Unable to create model for 'User': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] 
Unable to create model for 'Category': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] 
Unable to create model for 'Tag': Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified] 
Unable to put method 'POST' on resource at path '/pet': Invalid model name specified: null 
Unable to put method 'PUT' on resource at path '/pet': Invalid model name specified: null 
Unable to put method 'POST' on resource at path '/store/order': Invalid model name specified: null 
Unable to put method 'POST' on resource at path '/user': Invalid model name specified: null 
Unable to put method 'PUT' on resource at path '/user/{username}': Invalid model name specified: null 
Additionally, these warnings were found: 
Unsupported security definition type 'oauth2' for 'petstore_auth'. Ignoring. 
API Key security definition 'api_key' has unexpected name or location. Ignoring. 
Unable to insert model 'Pet' due to an unsatisfied schema reference. 
Reference to model 'Pet' not found. Ignoring. 
Reference to model 'Pet' not found. Ignoring. 
Reference to model 'Pet' not found. Ignoring. 
Reference to model 'Pet' in 200 response to method 'GET /pet/findByStatus' not found. Ignoring. 
Reference to model 'Pet' not found. Ignoring. 
Reference to model 'Pet' in 200 response to method 'GET /pet/findByTags' not found. Ignoring. 
Reference to model 'Pet' not found. Ignoring. 
Invalid format for model application/json for method GET 
Parameter type formData for parameter name not supported. Ignoring. 
Parameter type formData for parameter status not supported. Ignoring. 
Parameter type formData for parameter additionalMetadata not supported. Ignoring. 
Parameter type formData for parameter file not supported. Ignoring. 
Unsupported model type 'MapProperty' in 200 response to method 'GET /store/inventory'. Ignoring. 
Reference to model 'Order' not found. Ignoring. 
Reference to model 'Order' not found. Ignoring. 
Invalid format for model application/json for method GET 
Reference to model 'User' not found. Ignoring. 
Reference to model 'User' not found. Ignoring. 
Request schema for 'POST /user/createWithArray' has a reference to unknown model 'User'. Ignoring. 
API Gateway does not support Swagger's 'default' method response (found on 'POST /user/createWithArray') 
Reference to model 'User' not found. Ignoring. 
Request schema for 'POST /user/createWithList' has a reference to unknown model 'User'. Ignoring. 
API Gateway does not support Swagger's 'default' method response (found on 'POST /user/createWithList') 
Unsupported model type 'StringProperty' in 200 response to method 'GET /user/login'. Ignoring. 
API Gateway does not support Swagger's 'default' method response (found on 'GET /user/logout') 
Reference to model 'User' not found. Ignoring. 
Invalid format for model application/json for method GET 
Reference to model 'User' not found. Ignoring. 

답변

1

감사합니다. API 게이트웨이가 전체 사양 2.0 지원을 지원하기 위해 노력하는 동안 API 게이트웨이가 적용되는 제한 사항이있어 유효한 Swagger 파일이 실패 할 수 있습니다.

이는 AWS 포럼 여기에 자세히 설명되어있다 : https://forums.aws.amazon.com/message.jspa?messageID=720511

희망이 명확하게.

+0

AWS와 호환되도록 스키마를 변환하는 도구가 있습니다. 예를 들어 swaggerhub는 게이트웨이에 배포하기 전에 지원되지 않는 기능을 비활성화합니다. – fehguy

+0

@fehguy swaggerhub을 시도했지만 swagger 파일을 가져 왔지만 비활성화 된 AWS 지원되지 않는 기능을 내보내는 방법을 파악할 수 없습니다. – loretoparisi

0

aws api gateway로 위변조 정의를 가져 오는 것과 같은 오류가 많이 발생했습니다. 그들 모두는 내 API 예컨대에 의해 반환되는 내 모델 잭슨 JSON 정의를 추가 할 때 멀리 갔다 :

@JsonProperty("id") 
private String id; 

@JsonProperty("target") 
private Long target; 

내 수입의 모든 문제를 해결 내 모델의 모든 필드에 JsonProperty의 추가.