Comments (10)
Just a comment on this rather than opening a new issue:
the underlying HttpClient timeout should be exposed, there are numerous situations where it would be highly helpful to be able to change the default timeout of 100 seconds.
client.RequestTimeout or configuration.RequestTimeout are a few suggestions.
from docker.dotnet.
@jasoncouture - Actually these arent the same type of "timeout" issue. Can you open a new issue for this so we can track it independently?
from docker.dotnet.
@jterry75 Sorry for the late response, Sure thing.
from docker.dotnet.
I just started looking at this this morning.
In addition to specgen getting updated with the custom type mapping, I'm assuming we should have the custom Json Serialization attribute mapped there as well?
from docker.dotnet.
So I've got a rough draft of this working, though it is untested.
specgen is now outputting certain types to TimeSpan?
and you can specify on a per-property basis custom Attributes to decorate the property with.
On the json serialization of TimeSpan
attributes: would it be better to decorate the Property with the "standard" [JsonConvert(Type converterType)]
style, or to put in a IContractResolver
and custom Attributes
on the Properties to denote what should be serialized to/from seconds/nanoseconds?
I have it working both ways, but prefer the custom attributes path to help keep the consuming code clean.
from docker.dotnet.
@orthros,
Just my $0.02, I think the attribute is the better choice, because if we ever needed to change the contract resolver for something else it would be a headache.
from docker.dotnet.
@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 [JsonConvert(SecondsConverter)]
instead of the custom attributes if ya'll would rather do it that way.
from docker.dotnet.
I just filed another pull request that uses the builtin [JsonConvert]
attributes and adds a small enhancement to specgen.
from docker.dotnet.
@orthros - This is completed yes? Can we close?
from docker.dotnet.
Yes it is. Thank you!
from docker.dotnet.
Related Issues (20)
- MonitorEventsAsync syntax for --since param HOT 2
- Implement the Swarm Secrets 'Update a Secret'
- How to start an interactive session with StartContainerExecAsync? HOT 1
- Any plan for System.Text.Json? HOT 5
- /bin/bash: sudo test -f /repositories/gubbins/file.txt && echo true: No such file or directory
- [Question] equivalent api for docker service ps --no-trunc [swarm service name] HOT 2
- Not able to bind port to HostIp HOT 1
- What units are HealthConfig.StartPeriod in? HOT 1
- How to copy output from a container (E.g. output of an ML model) to the host machine
- Is there a way to manage stacks?
- README.md needs update because client.System.MonitorEventsAsync method is returning void not Stream.
- MonitorEventsAsync Progress Action is one event behind HOT 6
- Container does not receive stdin input
- .net8 build an image problem HOT 1
- BuildImageFromDockerFileAsync does not tag images correctly
- Container filters can't be negated HOT 6
- ServiceCreationMode is missing replicated-job and global-job
- Swarm.CreateServiceAsync doesn't return "Version" which means unable to do an UpdateServiceAsync afterwards
- .Net 8 upgrade: error occurred during the pre-login handshake
- Is this project alive? HOT 4
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 docker.dotnet.