X Tutup
Skip to content

docker java generate empty filter instead of no filter #557

@ylorenzati

Description

@ylorenzati

When i use ListContainersCmd with no filter, i expext to generate a request like that : /v1.23/containers/json

but with docker java i have that : /containers/json?filters=%7B%7D

That's because in ListContainersCmdExec

if (command.getFilters() != null) {
            webTarget = webTarget
                    .queryParam("filters", urlPathSegmentEscaper().escape(FiltersEncoder.jsonEncode(command.getFilters())));
        }

but command.getFilters() is never null, it's a Builder and it return an empty but not null map.

If you are ok i do a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup