-
Notifications
You must be signed in to change notification settings - Fork 368
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
Some of the timeout style properties should be TimeSpan #98
Comments
Just a comment on this rather than opening a new issue: client.RequestTimeout or configuration.RequestTimeout are a few suggestions. |
@jasoncouture - Actually these arent the same type of "timeout" issue. Can you open a new issue for this so we can track it independently? |
@jterry75 Sorry for the late response, Sure thing. |
I just started looking at this this morning. |
So I've got a rough draft of this working, though it is untested. specgen is now outputting certain types to On the json serialization of I have it working both ways, but prefer the custom attributes path to help keep the consuming code clean. |
@orthros, |
@jasoncouture thanks for the feedback! In my PR (#205 ), I wound up going with a single attribute that you can decorate with a Seconds or Nanoseconds enumeration like so [DataMember(Name = "Timeout", EmitDefaultValue = false)]
[TimeSpanSerialization(SerializationTarget.Nanoseconds)]
public TimeSpan Timeout { get; set; } which then gets intercepted in the ContractResolver. I wanted to avoid coupling the contract too closely with the serializer, and in his initial description @jterry75 mentioned introducing an Attribute, which I interpreted to be "custom" attribute 😄 I do see your point though; messing with the ContractResolver can be opaque at times. 'twould be a quick fix to refactor the code to use the |
I just filed another pull request that uses the builtin |
@orthros - This is completed yes? Can we close? |
Yes it is. Thank you! |
For example:
Config.StopTimeout
HealthConfig.Interval
HealthConfig.Timeout
etc.
This will require us to implement custom JsonConverters for TimeSpan but because sometimes the result is in Seconds and in others its NanoSeconds we likely need to introduce an attribute that describes the destination conversion expected.
The text was updated successfully, but these errors were encountered: