|
25 | 25 | import io.swagger.annotations.ApiParam;
|
26 | 26 | import org.springframework.core.annotation.Order;
|
27 | 27 | import org.springframework.stereotype.Component;
|
28 |
| -import springfox.documentation.schema.ModelRef; |
29 | 28 | import springfox.documentation.service.AllowableListValues;
|
30 | 29 | import springfox.documentation.service.AllowableValues;
|
31 | 30 | import springfox.documentation.spi.DocumentationType;
|
@@ -68,36 +67,23 @@ public boolean supports(DocumentationType delimiter) {
|
68 | 67 | private void fromApiParam(ParameterExpansionContext context, ApiParam apiParam) {
|
69 | 68 | String allowableProperty = emptyToNull(apiParam.allowableValues());
|
70 | 69 | AllowableValues allowable = allowableValues(fromNullable(allowableProperty), context.getField());
|
71 |
| - String name = isNullOrEmpty(context.getParentName()) |
72 |
| - ? context.getField().getName() |
73 |
| - : String.format("%s.%s", context.getParentName(), context.getField().getName()); |
74 | 70 | context.getParameterBuilder()
|
75 |
| - .name(name) |
76 | 71 | .description(apiParam.value())
|
77 | 72 | .defaultValue(apiParam.defaultValue())
|
78 | 73 | .required(apiParam.required())
|
79 | 74 | .allowMultiple(apiParam.allowMultiple())
|
80 |
| - .modelRef(new ModelRef(context.getDataTypeName())) |
81 | 75 | .allowableValues(allowable)
|
82 |
| - .parameterType("query") |
83 | 76 | .parameterAccess(apiParam.access())
|
84 | 77 | .build();
|
85 | 78 | }
|
86 | 79 |
|
87 | 80 | private void fromApiModelProperty(ParameterExpansionContext context, ApiModelProperty apiModelProperty) {
|
88 | 81 | String allowableProperty = emptyToNull(apiModelProperty.allowableValues());
|
89 | 82 | AllowableValues allowable = allowableValues(fromNullable(allowableProperty), context.getField());
|
90 |
| - String name = isNullOrEmpty(context.getParentName()) ? context.getField().getName() : String.format("%s.%s", |
91 |
| - context.getParentName(), |
92 |
| - context.getField().getName()); |
93 | 83 | context.getParameterBuilder()
|
94 |
| - .name(name) |
95 | 84 | .description(apiModelProperty.value())
|
96 |
| - .defaultValue(null) |
97 | 85 | .required(apiModelProperty.required())
|
98 |
| - .allowMultiple(Boolean.FALSE) |
99 |
| - .modelRef(new ModelRef(context.getDataTypeName())) |
100 |
| - .allowableValues(allowable).parameterType("query") |
| 86 | + .allowableValues(allowable) |
101 | 87 | .parameterAccess(apiModelProperty.access())
|
102 | 88 | .build();
|
103 | 89 | }
|
|
0 commit comments