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

No response returned when last step is aliased #31

Closed
calebschoepp opened this issue May 6, 2021 · 2 comments
Closed

No response returned when last step is aliased #31

calebschoepp opened this issue May 6, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@calebschoepp
Copy link
Contributor

When as is used to alias the output of the last step for a resource, Atmo returns nothing. For example the following returns nothing:

handlers:
  - type: request
    resource: /hello
    method: POST
    steps:
      - fn: helloworld
        as: something

Without looking at the codebase yet I'm assuming this is because Atmo implicitly assumes the final output matches the name of the last step. I think this should either be explicitly documented, or it should be surfaced as something you can modify. For example an output field that would allow you to declare where to look for the final output. Hopefully I'm not misunderstanding how data is passed between runnables 🤞

@cohix
Copy link
Contributor

cohix commented May 6, 2021

@calebschoepp this is a good point, and you're exactly right about the reasoning. There is already in fact that option, if you were to do the following:

handlers:
  - type: request
    resource: /hello
    method: POST
    steps:
      - fn: helloworld
        as: something
    response: something

That would work as you describe. I'm on the fence about whether something aliased should be returned automatically, as it's entirely possible that you explicitly DO NOT want to return something (I've done something like as: "--" in the past to return an empty response with 200 status)

Regardless, your point about documenting it explicitly stands. Let me think a bit about the behaviour, and we'll leave this open for sure.

@cohix cohix added the documentation Improvements or additions to documentation label May 6, 2021
@calebschoepp
Copy link
Contributor Author

@cohix I was not aware of the response field. I think that the use case you bring up of not wanting to return something is completely valid. Documenting this behaviour or even just mentioning the response field in the docs (probably this page) would probably be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants