Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed undefined and null responseParameter values #759

Merged
merged 1 commit into from Jul 27, 2019
Merged

Fixed undefined and null responseParameter values #759

merged 1 commit into from Jul 27, 2019

Conversation

jormaechea
Copy link
Contributor

Handled undefined and null reponseParameter values.

Closes #758

@dnalborczyk
Copy link
Collaborator

thank you @jormaechea !

@jormaechea
Copy link
Contributor Author

@dnalborczyk any idea of when this Fix will be released? 😄

@dnalborczyk
Copy link
Collaborator

dnalborczyk commented Aug 1, 2019

any idea of when this Fix will be released?

hey @jormaechea should be very soon!

I'm in the midst of adding more tests. Do you have a simple scenario in form of a serverless.yml and a handler file (which fails without your fix) I could add to the tests? That would be great.

@jormaechea
Copy link
Contributor Author

@dnalborczyk the test case for this one is very similar to the other PR. This time, trying to access an undefined property.

serverless.yml

service: TestService

provider:
  name: aws
  runtime: nodejs10.x
  region: us-east-1

functions:
  HelloWorldApi:
    handler: index.handler
    description: Hello World API
    events:
      - http:
          integration: lambda
          path: hello-world
          method: get
          responses:
            default:
              responseModels:
                application/json;charset=UTF-8: Empty
              responseParameters:
                method.response.header.x-foo: "integration.response.body.more-foo.property-of-undefined"
              responseTemplates:
                application/json;charset=UTF-8: ""
              statusCode: 200

plugins:
  - serverless-offline

index.js

module.exports.handler = async () => {
	return {
		foo: 'bar'
	};
};

dnalborczyk added a commit that referenced this pull request Aug 2, 2019
@dnalborczyk
Copy link
Collaborator

thank you @jormaechea !

@dnalborczyk
Copy link
Collaborator

any idea of when this Fix will be released?

@jormaechea

released as part of v6.0.0-alpha.0: https://github.com/dherault/serverless-offline/releases/tag/v6.0.0-alpha.0

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.

Error when processing an undefined or null response header from body
2 participants