Skip to content

fix: Set nullable types in operation classes/interfaces#74

Merged
HofmeisterAn merged 11 commits intotestcontainers:mainfrom
campersau:fixnullableoperations
Mar 4, 2026
Merged

fix: Set nullable types in operation classes/interfaces#74
HofmeisterAn merged 11 commits intotestcontainers:mainfrom
campersau:fixnullableoperations

Conversation

@campersau
Copy link

Some parameters can be null like

ContainersPruneParameters parameters = null

so the parameters should be marked as nullable

ContainersPruneParameters? parameters = null

Also replaced default(CancellationToken) with default for consistency.

Changes only affect *Operations interfaces / classes.

Copy link
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.

Thanks for the PR. I have two quick questions.

Some operation interfaces still use ... CancellationToken cancellationToken);. Probably something we should align too?

@campersau campersau force-pushed the fixnullableoperations branch from 1504220 to 209db97 Compare March 3, 2026 08:51
@campersau
Copy link
Author

Some operation interfaces still use ... CancellationToken cancellationToken);. Probably something we should align too?

I have fixed them. There were just 3 in the interfaces and two of them are actually obsolete.

@campersau
Copy link
Author

Also some interfaces are implemented explicitly and others are not. If you want I can also make them consistent (either way).

@HofmeisterAn
Copy link
Collaborator

Also some interfaces are implemented explicitly and others are not. If you want I can also make them consistent (either way).

If we change it, it would be great to align and make it consistent (as long as it's not too much work). I don't think there's a need to implement them explicitly?

@campersau
Copy link
Author

If we change it, it would be great to align and make it consistent (as long as it's not too much work). I don't think there's a need to implement them explicitly?

All Operations interfaces are now implemented implicitly.
I also updated the code to be more consistent.

Copy link
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.

Thanks for all the effort. I slightly polished the changes and made them more consistent. If you're okay with the updates, I'm happy to merge the PR. Thanks again!

@HofmeisterAn HofmeisterAn changed the title Fix nullable annotations in *Operations fix: Set nullable types in operations classes/interfaces Mar 3, 2026
@HofmeisterAn HofmeisterAn changed the title fix: Set nullable types in operations classes/interfaces fix: Set nullable types in operations interfaces and classes Mar 3, 2026
@HofmeisterAn HofmeisterAn changed the title fix: Set nullable types in operations interfaces and classes fix: Set nullable types in operation classes/interfaces Mar 3, 2026
Copy link
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.

Thanks 🙏.

You've contributed a lot recently, so I wanted to give you a quick update on what I'm planning to work on next for Docker.DotNet. My goal is to refactor the API (operation interfaces) to support multiple Docker Engine APIs to support the API downgrade feature, along with ongoing cleanups.

I'm not entirely sure how to approach this yet. For now, I'm thinking of introducing a new API alongside the existing one and transitioning to the new API over time. This also include better auto-generated model classes and interfaces (specgen) to streamline development (probably without netstandard support).

@HofmeisterAn HofmeisterAn added the enhancement New feature or request label Mar 4, 2026
@HofmeisterAn HofmeisterAn merged commit 158e3e0 into testcontainers:main Mar 4, 2026
15 checks passed
@campersau campersau deleted the fixnullableoperations branch March 4, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants