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

Response parameters bug fix #757

Merged
merged 2 commits into from Jul 25, 2019
Merged

Response parameters bug fix #757

merged 2 commits into from Jul 25, 2019

Conversation

jormaechea
Copy link
Contributor

Fixed a typo to fix the bug.

Closes #756

@dnalborczyk dnalborczyk merged commit afa68d0 into dherault:master Jul 25, 2019
@dnalborczyk
Copy link
Collaborator

Thank you @jormaechea !

@dnalborczyk
Copy link
Collaborator

hey @jormaechea same here, 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?

@jormaechea
Copy link
Contributor Author

jormaechea commented Aug 1, 2019

Sure @dnalborczyk. This simple case does not work properly:

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.foo"
              responseTemplates:
                application/json;charset=UTF-8: ""
              statusCode: 200

plugins:
  - serverless-offline

index.js

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

It prints this warning in the console:

Serverless: Warning: while processing responseParameter "0": "method.response.header.x-foo"
Serverless: Offline plugin only supports "method.response.header.PARAM_NAME" left-hand responseParameter. Found "0" instead. Skipping.
Serverless: If you think this is an issue with the plugin please submit it, thanks!
Serverless: https://github.com/dherault/serverless-offline/issues

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

thanks again @jormaechea !

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 responseParameters
2 participants