Skip to content

Conversation

praneetap
Copy link
Contributor

@praneetap praneetap commented May 23, 2019

Issue #, if available:
#191 #627
Description of changes:
Adding OpenApi 3.0 support for non-auth use cases. This adds a global/api flag called OpenApiVersion, which when specified -

  1. with value 2.0 or 3.0, fixes the issue SAM Creates stage named "Stage" by default? #191
  2. With value 3.0, changes the swagger to openapi 3.0 format.

Description of how you validated changes:
Added tests, and end to end tests.
Checklist:

  • Write/update tests
  • make pr passes
  • Update documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@praneetap
Copy link
Contributor Author

#191

@praneetap
Copy link
Contributor Author

#627

@praneetap praneetap changed the title [WIP] openapi version 3 support non-auth changes feat: openapi version 3 support non-auth changes May 24, 2019
@praneetap praneetap requested review from keetonian and brettstack May 24, 2019 05:56
chore: update test_translator.py (aws#933)
@codecov-io
Copy link

codecov-io commented May 24, 2019

Codecov Report

Merging #932 into develop will increase coverage by 0.12%.
The diff coverage is 97.56%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #932      +/-   ##
===========================================
+ Coverage    94.73%   94.86%   +0.12%     
===========================================
  Files           69       69              
  Lines         3018     3055      +37     
  Branches       562      573      +11     
===========================================
+ Hits          2859     2898      +39     
  Misses          84       84              
+ Partials        75       73       -2
Impacted Files Coverage Δ
samtranslator/model/apigateway.py 97.72% <ø> (ø) ⬆️
samtranslator/model/sam_resources.py 95.5% <ø> (ø) ⬆️
samtranslator/model/api/api_generator.py 95.83% <100%> (+1.54%) ⬆️
samtranslator/plugins/globals/globals_plugin.py 100% <100%> (ø) ⬆️
samtranslator/swagger/swagger.py 97.73% <100%> (+0.14%) ⬆️
samtranslator/plugins/globals/globals.py 99% <93.75%> (-1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ccf4fc...3a8719f. Read the comment docs.

if self.open_api_version:
if re.match(SwaggerEditor.get_openapi_versions_supported_regex(), self.open_api_version) is None:
raise InvalidResourceException(
self.logical_id, "The OpenApiVersion value must be of the format 3.0.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 3.0.0 doesn't seem like a format, but I think this is still understandable.

Copy link
Contributor

@keetonian keetonian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Have you deployed any of these OpenApi 3.0 templates to verify that they work in CFN?

@praneetap
Copy link
Contributor Author

Looks good. Have you deployed any of these OpenApi 3.0 templates to verify that they work in CFN?
@keetonian
I could deploy this successfully

Globals:
  Api:
    OpenApiVersion: '3.0.1'

Resources:
  ImplicitApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://praneep-test-2/thumbnails.zip
      Handler: index.gethtml
      Runtime: nodejs8.10
      Events:
        GetHtml:
          Type: Api
          Properties:
            Path: /
            Method: get

@praneetap praneetap merged commit 7859f19 into aws:develop Jun 3, 2019
praneetap added a commit to praneetap/serverless-application-model that referenced this pull request Jun 5, 2019
brettstack pushed a commit that referenced this pull request Jun 12, 2019
* chore: update test_translator.py (#933)

* fix: partitionalize arn in StepFunctionsExecutionPolicy (#941)

* fix: fix a deprecation warning from jsonschema 3.x (#946)

For example, in https://travis-ci.org/awslabs/serverless-application-model/jobs/538917819:

/home/travis/build/awslabs/serverless-application-model/.tox/py36/lib/python3.6/site-packages/jsonschema/validators.py:893: DeprecationWarning: The metaschema specified by $schema was not found. Using the latest draft to validate, but this will raise an error in the future.
  cls = validator_for(schema)

* feat: openapi version 3 support non-auth changes (#932)

* feat: openapi support for auth usecases (#949)

* chore: Fixing security alerts on the repo

* addressed cr comments
@praneetap praneetap deleted the oas3 branch August 1, 2019 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants