Skip to content

Map time.Duration to TimeSpan everywhere#98

Open
campersau wants to merge 7 commits intotestcontainers:mainfrom
campersau:timespanbytes
Open

Map time.Duration to TimeSpan everywhere#98
campersau wants to merge 7 commits intotestcontainers:mainfrom
campersau:timespanbytes

Conversation

@campersau
Copy link
Copy Markdown

@campersau campersau commented Apr 17, 2026

Uses TimeSpanNanosecondsConverter for all time.Duration fields.
Use byte[] instead of List<byte> which JsonSerializer supports natively so Base64Converter can be removed.

Comment thread src/Docker.DotNet/JsonTimeSpanSecondsConverter.cs
Copy link
Copy Markdown
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! My only suggestion is to align the converter names, right now they're not consistent. WDYT?

  • ConsoleSizeConverter
  • JsonDateTimeConverter
  • JsonEnumMemberConverter
  • JsonTimeSpanNanoSecondsConverter (Nanoseconds)
  • TimeSpanSecondsConverter

Comment thread src/Docker.DotNet/JsonTimeSpanNanoSecondsConverter.cs Outdated
@campersau
Copy link
Copy Markdown
Author

LGTM, thanks! My only suggestion is to align the converter names, right now they're not consistent. WDYT?

  • ConsoleSizeConverter
  • JsonDateTimeConverter
  • JsonEnumMemberConverter
  • JsonTimeSpanNanoSecondsConverter (Nanoseconds)
  • TimeSpanSecondsConverter

I did rename them. All have now a Json prefix.

Should I rename these?

  • BoolQueryStringConverter -> QueryStringBoolConverter
  • EnumerableQueryStringConverter -> QueryStringEnumerableConverter

Could also be in a follow up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants