Open Numpsy opened 3 years ago
Not sure why it won't compile 🤔 I'll check it out. generally if you have many args, using a record as input with named fields will be much better since you can see what is what more clearly
Yes, I have that approach working seperately (with a pattern of TRequest -> Async
Thanks
Hi @Numpsy is this issue still valid? can you please give it another go with latest packages?
I'll give it a try later.
Hi, It still looks the same to me using Fable.Remoting.AspNetCore 2.22.0 (this is using the AspNetCore bits directly, so no Giraffe etc, for the record.)
I'm also experiencing this issue. I also can't see any examples in the documentation UI.
Hi @vKito the issue still stands I believe. As a temp workaround you can either use a record with named fields or a tuple
Isn't the problem simply the fact that there's support only for 1 and 2 parameter functions? I guess it's not possible to generalize this with an expression taking functions with arbitrary arity?
Yup, I refactored my endpoint to accept a single value instead. Works this way thanks. At the same time I feel the need to point out a gotcha with the examples:
This is more a general quoted expression gotcha but I thought I would point it out for anyone needing help. If you pass in values that get computed at runtime, e.g. GUIDs, then the docs UI won't show any examples, but everything still compiles fine.
docs.route <@ fun api -> api.AddProductToCart @>
|> docs.example <@ fun api -> api.AddProductToCart(Guid.NewGuid(), Guid.NewGuid() @> // example Guids for cart id and product id
The woraround to this is to simply create the GUID outside the quoted expression
let cartId = Guid.NewGuid()
let productId = Guid.NewGuid()
docs.example <@ fun api -> api.AddProductToCart(cartId, productId) @>
Hi,
Say that I have this example from the documentation:
I tried plugging in documentation entries for that, and got:
Should that work, or am I doing something silly?
Thanks