Hawaii icon indicating copy to clipboard operation
Hawaii copied to clipboard

Multiple client request parameters as a record

Open Alex2357 opened this issue 1 year ago • 0 comments

I need to work with an API which has multiple request header parameters. The client methods were generated as

    member this.PostMyMethod
        (
            prm1: string,
            prm2: string, 
...
            ?prmN: someType,
        )

I have nearly 10 parameters. While this could be done I really do not like passing 10 parameters if I could pass a single record object. I did not find in any options if I could specify wrapping all of them into a record type. Can I do this?

Why I need this? If I have 5 optional parameters, if I create a record with all of them manually then to perform the correct calls with optional parameters and their permutations it is quite a lot of calls need to be written. I can not pass an Option<T> as a value as I need to pass T.

Alex2357 avatar Oct 20 '23 04:10 Alex2357