-
Notifications
You must be signed in to change notification settings - Fork 57
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
uuid type does not serialize correctly #140
Comments
Is this parameter in your schema specified as not required? |
It is defined as an optional header (X-Token). I can upload the part of the
schema but it will be a few days til I can
…On Tue, 10 Dec 2019, 9:05 pm Sergey Tihon, ***@***.***> wrote:
Is this parameter in your schema specified as not required?
What is the location for parameters? url/header/body?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#140?email_source=notifications&email_token=AMAM73GC3HB4WAEDZIBQ5NLQX5SW5A5CNFSM4JYXGN4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGOVTOA#issuecomment-563960248>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAM73G5J6AGMI3KRQZVC53QX5SW5ANCNFSM4JYXGN4A>
.
|
minimal schema obtained. The schema is generated by swashbuckler:
|
Workaround: type LoggingHandler(log:ILog, messageHandler) =
inherit DelegatingHandler(messageHandler)
// https://wizardsofsmart.wordpress.com/2014/05/13/how-to-use-base-sendasync-in-f-delegatinghandler/
member private x.SendAsync' (request, cancellationToken) =
base.SendAsync(request, cancellationToken)
override this.SendAsync (request, cancellationToken) = task {
// https://github.com/fsprojects/SwaggerProvider/issues/140
let name = "X-GUID"
if request.Headers.Contains name then
let value = request.Headers.GetValues(name) |> Seq.head
request.Headers.Remove name |> ignore
request.Headers.Add(name,[value.Split([|'(';')'|]).[1]])
return this.SendAsync' (request, cancellationToken) |
ghost
mentioned this issue
Apr 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recent changes introduced by #137 cause optional uuid types to be written to the wire as e.g. 'Some(c5bff7f0-b4df-475e-a331-f737424f013c)'. This is quite a tricky area but I would suggest:
defaultArg theGuid Guid.Empty
would potentially be more compatible, but this is a bit opinionated.Workaround:
It is possible to use
DelegatingHandler
(example #132 (comment)) to replace Some(guid) with guid.The text was updated successfully, but these errors were encountered: