forked from loafle/openapi-generator-original
Fix alias to map response (#1067)
* fix response reference to map * update samples * add null check for openapi
This commit is contained in:
@@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.client.model.StringBooleanMap;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.*;
|
||||
import javax.xml.bind.annotation.*;
|
||||
|
||||
@@ -92,9 +91,11 @@ public class MapTest {
|
||||
private Map<String, Boolean> directMap = null;
|
||||
|
||||
@JsonProperty("indirect_map")
|
||||
@JacksonXmlProperty(localName = "indirect_map")
|
||||
@XmlElement(name = "indirect_map")
|
||||
private StringBooleanMap indirectMap = null;
|
||||
// Is a container wrapped=false
|
||||
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=Boolean
|
||||
@XmlElement(name = "inner")
|
||||
private Map<String, Boolean> indirectMap = null;
|
||||
|
||||
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
@@ -174,21 +175,29 @@ public class MapTest {
|
||||
this.directMap = directMap;
|
||||
}
|
||||
|
||||
public MapTest indirectMap(StringBooleanMap indirectMap) {
|
||||
public MapTest indirectMap(Map<String, Boolean> indirectMap) {
|
||||
this.indirectMap = indirectMap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
|
||||
if (this.indirectMap == null) {
|
||||
this.indirectMap = new HashMap<String, Boolean>();
|
||||
}
|
||||
this.indirectMap.put(key, indirectMapItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get indirectMap
|
||||
* @return indirectMap
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public StringBooleanMap getIndirectMap() {
|
||||
public Map<String, Boolean> getIndirectMap() {
|
||||
return indirectMap;
|
||||
}
|
||||
|
||||
public void setIndirectMap(StringBooleanMap indirectMap) {
|
||||
public void setIndirectMap(Map<String, Boolean> indirectMap) {
|
||||
this.indirectMap = indirectMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user