Skip to content

Commit

Permalink
Merge pull request #2081 from gzsombor/fix-multiple-field-with-the-sa…
Browse files Browse the repository at this point in the history
…me-type

Fix child expansion context creation
  • Loading branch information
dilipkrish committed Oct 31, 2017
2 parents 07d1b72 + 2c7c77a commit ec9af57
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public ExpansionContext childContext(
String parentName,
ResolvedType paramType,
DocumentationContext documentationContext) {
seenTypes.add(paramType);
return new ExpansionContext(parentName, paramType, documentationContext, seenTypes);
Set<ResolvedType> childSeenTypes = newHashSet(seenTypes);
childSeenTypes.add(paramType);
return new ExpansionContext(parentName, paramType, documentationContext, childSeenTypes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public void bug1627(@RequestBody Bug1627 body) {
throw new UnsupportedOperationException();
}

@RequestMapping(value = "2081", method = GET)
public void bug2081(Bug2081 criteria) {
throw new UnsupportedOperationException();
}

@ApiOperation(value = "Remove an apple from a user", notes = "Remove an apple from a user. You must specify the "
+ "user name and the apple name.", response = Void.class, consumes = "application/json, application/xml",
produces = "application/json, application/xml")
Expand Down Expand Up @@ -470,4 +475,33 @@ public void setExample(Example example) {
this.example = example;
}
}

public static class Bug2081Filter {
String importantField;

public String getImportantField() {
return importantField;
}

public void setImportantField(String importantField) {
this.importantField = importantField;
}
}

public static class Bug2081 {
Bug2081Filter a;
Bug2081Filter b;
public Bug2081Filter getA() {
return a;
}
public void setA(Bug2081Filter a) {
this.a = a;
}
public Bug2081Filter getB() {
return b;
}
public void setB(Bug2081Filter b) {
this.b = b;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,36 @@
}
}
}
}
},
"/bugs/2081{?a.importantField,b.importantField}": {
"get": {
"tags": [
"Bugs"
],
"summary": "bug2081",
"operationId": "bug2081UsingGET_2",
"consumes":["application/json"],
"parameters": [
{
"name": "a.importantField",
"in": "query",
"required":false,
"type":"string"
},
{
"name":"b.importantField",
"in":"query",
"required":false,
"type":"string"
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"securityDefinitions": {
"api_key": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,36 @@
}
}
}
}
},
"/bugs/2081{?a.importantField,b.importantField}": {
"get": {
"tags": [
"Bugs"
],
"summary": "bug2081",
"operationId": "bug2081UsingGET_1",
"consumes":["application/json"],
"parameters": [
{
"name": "a.importantField",
"in": "query",
"required":false,
"type":"string"
},
{
"name":"b.importantField",
"in":"query",
"required":false,
"type":"string"
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"securityDefinitions": {
"api_key": {
Expand Down

0 comments on commit ec9af57

Please sign in to comment.