2016-10-04 28 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 Gatewayは完全なswagger 2.0仕様をサポートするよう努めていますが、有効なswaggerファイルが失敗する可能性があるAPI Gatewayが強制する制限があります。

これはAWSフォーラムで、ここで詳細に議論されています:https://forums.aws.amazon.com/message.jspa?messageID=720511

が、これは明確に願っています。

+0

AWSと互換性があるようにスキーマを変換するツールがあります。たとえば、swaggerhubはゲートウェイにデプロイする前にサポートされていない機能を無効にします。 – fehguy

+0

@fehguy私はswaggerhubを試していました。私はswaggerファイルをインポートしましたが、無効にするAWSサポートされていない機能をエクスポートする方法を理解することはできません。 – loretoparisi

0

awsiのゲートウェイにこのような曖昧な定義をインポートするなど、多くのエラーが発生しました。それらのすべては、私は私のAPI例えばによって返されて、私のモデルにジャクソンのJSON定義を追加したときに去って行った:

@JsonProperty("id") 
private String id; 

@JsonProperty("target") 
private Long target; 

私の輸入問題のすべてを解決し、私のモデルのフィールドの全てにJsonPropertyの追加。

関連する問題