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

[Feature Request] Expose Requested Content-Type In /system/functions #1333

Closed
Miserlou opened this issue Oct 3, 2019 · 7 comments
Closed

Comments

@Miserlou
Copy link

Miserlou commented Oct 3, 2019

Different functions in the OpenFaaS function store behave differently when receiving content with different Content-Type headers. Some expect text/plain and return null otherwise, some expect application/json and return null otherwise, and some return the same thing no matter what.

There is no way to know apriori which the function expects, making it difficult to build complex pipelines without manually knowing and preparing requests based on what each function expects.

It would be much better if I could use the /system/functions endpoint to see which it expects so that pipelines could be built programatically.

Even better would be if we could could just not have to worry about this at all, and simply mandate that all functions speak application/json in and out.

@jonatasbaldin
Copy link

My thoughts:

  • What if a function accepts different Content-Types depending on the user input? Maybe a very edge case tho
  • I think this is more related to the function documentation than the infrastructure, which should not care about which Content-Type is being sent or which one the function accepts
  • Forcing application/json also disables other use cases, like sending binary data

What do you think?

@Miserlou
Copy link
Author

Miserlou commented Oct 4, 2019

I agree about not wanting to limit the use cases (ex, for binary data), so I think that would be an argument to have this exposed in a manifest (maybe with application/json or text/plain as an assumed default by convention).

@alexellis
Copy link
Member

/add label: question

@derek derek bot added the question label Oct 5, 2019
@alexellis
Copy link
Member

/add label: duplicate

@derek derek bot added the duplicate label Oct 5, 2019
@alexellis
Copy link
Member

Duplicate of #1337

@alexellis alexellis marked this as a duplicate of #1337 Oct 5, 2019
@alexellis
Copy link
Member

@Miserlou thank you for your suggestion, it was already being tracked on Trello, but I've created an issue for it too.

@alexellis
Copy link
Member

/lock: move to the new thread

@derek derek bot locked and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants