forked from aws/serverless-application-model
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle 'Invalid Swagger Document' and refactor some validation into S…
…wagger Editor constructor (aws#2263) * handle 'Invalid Swagger Document' and refactor some validation into Swagger Editor constructor * missed removing a comment * move path item validation into method * update new function to use swagger editor instance * small change, changing test to use swagger instead of openapi * update deployment hashes in some updated tests * add docstring :raises
- Loading branch information
Showing
30 changed files
with
166 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/translator/input/error_api_definition_body_invalid_openapi_version.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Resources: | ||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionBody: | ||
info: | ||
version: '1.0' | ||
title: 'title' | ||
paths: | ||
"/some/path": {} | ||
"/other": {} | ||
openapi: '2.0' |
11 changes: 11 additions & 0 deletions
11
tests/translator/input/error_api_definition_body_invalid_paths.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Resources: | ||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionBody: | ||
info: | ||
version: '1.0' | ||
title: 'title' | ||
openapi: 3.0.1 | ||
paths: 'invalid' |
12 changes: 12 additions & 0 deletions
12
tests/translator/input/error_api_definition_body_missing_openapi_or_swagger.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Resources: | ||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionBody: | ||
info: | ||
version: '1.0' | ||
title: 'title' | ||
paths: | ||
"/some/path": {} | ||
"/other": {} |
10 changes: 10 additions & 0 deletions
10
tests/translator/input/error_api_definition_body_missing_paths.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Resources: | ||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionBody: | ||
info: | ||
version: '1.0' | ||
title: 'title' | ||
openapi: 3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,5 @@ Resources: | |
StageName: Prod | ||
DefinitionUri: s3://foo/bar | ||
DefinitionBody: | ||
a: b | ||
c: d | ||
paths: {} | ||
openapi: "3.0.1" |
Oops, something went wrong.