8000 `containerDefaultToNull` behavior · Issue #12542 · swagger-api/swagger-codegen · GitHub
[go: up one dir, main page]

Skip to content
containerDefaultToNull behavior #12542
@zys864

Description

@zys864

when set containerDefaultToNull to false. eg data

data will init as new ArrayList<>().

but when we set data as null in request

{
     "data": null
}
public void setData(List<@Size(min = 1, max = 64)String> data) {
        this.data = data;
    }

data was override to null.

epxected as empty array,should be follow example

public void setData(List<@Size(min = 1, max = 64)String> data) {
      if(data== null){
          return;
      }
        this.data = data;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0