Comments (10)
Thanks. I don't plan on it being a permanent limitation - its more just time and getting round to it!
from functionmonkey.
@MrBliz wouldn't that be done via query parameters?
from functionmonkey.
It should “just work” for GET and DELETE verbs, there should be some docs in the section on routing:
https://functionmonkey.azurefromthetrenches.com/guides/http/routing.html
from functionmonkey.
I think it’s “just” an OpenApi doc issue - the way the parameter mapping works any parameters you don’t specify will just get the default values from your classes constructor.
I’ll fix the issue with the doc gen, let me know if you find they are actually required in practice as that would be a nasty bug!
I can’t remember if it was yourself looking for header binding but that’s nearly complete now.
from functionmonkey.
Cool, what’s your workaround? I’ve just being making optional params nullable, but then they don’t show up in swagger...
from functionmonkey.
Generally I've defined two routes:
.../myroute
.../myroute/{param}
And thats worked for me as they've made use of different commands. Other than that I think you'd need to use a query parameter.
I am planning to do some work on Function Monkey in the next few days. Can you give me a couple of example routes you'd like to use and if I get a chance I'll see if I can work that in.
from functionmonkey.
The biggest use case I have for optional params is for paging, sorting and filtering where there might be multiple optional parameters eg: filter, page number, page size, sort column, sort direction.
from functionmonkey.
Maybe i'm missing something, but how do you use Query Parameters here? You need to supply an ICommand to the HttpFunctionBuilder?
from functionmonkey.
Re: Query Parameters
If i have the following class
public class EventListQuery
{
public int PageNumber { get; set; }
public int PageSize { get; set; }
public string Filter { get; set; }
public bool Descending { get; set; }
/// <summary>
/// Sortable Columns : Name, EventDate
/// </summary>
public string SortColumn { get; set; }
}
In Swagger using Function Monkey the propertis are marked as required.
If use the same class in a non function monkey project
The properties are all optional, i have to explicitly set them as [Required]
from functionmonkey.
Optional route parameters now work and are in the imminent v1.0.0 release. They follow the approach documented here:
from functionmonkey.
Related Issues (20)
- CamelCaseJsonSerializer does not work for ExpandoObject
- HttpResponseHandler not used for BadParameterResponse in http.csharp.handlebars HOT 1
- Receive and add CancellationToken to DI to enable for graceful shutdowns HOT 1
- Compiling Azure Functions with NuGet package dependencies fails HOT 13
- Problems with StorageQueue in 4.0.56-beta4 HOT 2
- Event Grid Triggers
- Unable to upload a file
- HowTo BeforeServiceProviderBuild HOT 1
- Solution Structure
- Http Trigger: AuthorizationLevel.Anonymous runs ClaimsPrincipalAuthorization but it should be ignored HOT 3
- How to access Cookie (and QueryString) collection ?
- Future of Function Monkey HOT 10
- Compiler Build Error with Entity Framework Core HOT 4
- Add Validators via Assembly search not working HOT 2
- Primitives / Arrays in HTTP body
- Need a way to access full HttpContext HOT 2
- FunctionMonkey.Compiler can't be built
- Accessing request headers
- Azure App Configuration in Configuration.
- CosmosDB lease container appears inoperable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functionmonkey.