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

HTTP routes don't work for optional strings #224

Closed
brettsam opened this issue May 3, 2017 · 0 comments
Closed

HTTP routes don't work for optional strings #224

brettsam opened this issue May 3, 2017 · 0 comments
Assignees

Comments

@brettsam
Copy link
Member

brettsam commented May 3, 2017

From this post: http://stackoverflow.com/questions/43748806/how-to-do-rest-api-optional-string-uri-parameter-with-azure-function-http-bindin

You can't add a route like "route": "books/{bookName?}" and use a string for bookName in your function -- we'll throw if the bookName part of the URL is missing.

The issue looks to be here: https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Host/Bindings/Data/ClassDataBinding.cs#L63. If the value of the object is null, that evaluates to false, and you get the exception.

This works for ints (for example) because they are structs and that is handled differently here: https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Host/Bindings/Data/StructDataBinding.cs#L71

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

No branches or pull requests

2 participants