Skip to content

Commit d9e0a90

Browse files
HugoMariofrantuma
authored andcommitted
removed commented code and unused imports on swagger-core modules
1 parent 1dd6ce3 commit d9e0a90

File tree

37 files changed

+22
-114
lines changed

37 files changed

+22
-114
lines changed

modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
328328
}
329329

330330
if (isPrimitive) {
331-
if (annotatedType.isSchemaProperty()) {
332-
//model.name(name);
333-
}
334331
XML xml = resolveXml(beanDesc.getClassInfo(), annotatedType.getCtxAnnotations(), resolvedSchemaAnnotation);
335332
if (xml != null) {
336333
model.xml(xml);
@@ -435,7 +432,6 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
435432
Schema mapModel = new MapSchema().additionalProperties(addPropertiesSchema);
436433
mapModel.name(name);
437434
model = mapModel;
438-
//return model;
439435
} else if (valueType != null) {
440436
if (ReflectionUtils.isSystemType(type) && !annotatedType.isSchemaProperty() && !annotatedType.isResolveAsRef()) {
441437
context.resolve(new AnnotatedType().type(valueType).jsonViewAnnotation(annotatedType.getJsonViewAnnotation()));
@@ -634,7 +630,6 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
634630
AnnotatedType aType = new AnnotatedType()
635631
.type(propType)
636632
.ctxAnnotations(annotations)
637-
//.name(propName)
638633
.parent(model)
639634
.resolveAsRef(annotatedType.isResolveAsRef())
640635
.jsonViewAnnotation(annotatedType.getJsonViewAnnotation())
@@ -654,8 +649,6 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
654649
return null;
655650
} else {
656651
return new Schema();
657-
//t.jsonUnwrappedHandler(null);
658-
//return context.resolve(t);
659652
}
660653
});
661654
property = clone(context.resolve(aType));

modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/SwaggerModule.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
public class SwaggerModule extends SimpleModule {
66
private static final long serialVersionUID = 1L;
77

8-
/*
9-
/**********************************************************
10-
/* Life-cycle
11-
/**********************************************************
12-
*/
13-
148
public SwaggerModule() {
159
super(PackageVersion.VERSION);
1610
}

modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/mixin/MediaTypeMixin.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* Copyright 2021 SmartBear Software
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.swagger.v3.core.jackson.mixin;
218

319
import com.fasterxml.jackson.annotation.JsonAnyGetter;

modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/mixin/Schema31Mixin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
@JsonPropertyOrder(value = {"type", "format", "if", "then", "else"}, alphabetic = true)
2020
public abstract class Schema31Mixin {
2121

22-
//@JsonValue
2322
@JsonIgnore
2423
public abstract Map<String, Object> getJsonSchema();
2524

modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,7 @@ public static Optional<Header> getHeader(io.swagger.v3.oas.annotations.headers.H
942942
if (header.schema() != null) {
943943
if (header.schema().implementation().equals(Void.class)) {
944944
AnnotationsUtils.getSchemaFromAnnotation(header.schema(), jsonViewAnnotation).ifPresent(
945-
headerObject::setSchema
946-
//schema inline no need to add to components
947-
//components.addSchemas(schema.getType(), schema);
948-
);
945+
headerObject::setSchema);
949946
}
950947
}
951948

@@ -1445,7 +1442,6 @@ else if (tS != null && cS == null && cA == null) {
14451442
}
14461443

14471444
else if (tS != null && cS != null) {
1448-
//return mergeSchemaAnnotations(cS, tS);
14491445
return mergeSchemaAnnotations(tS, cS);
14501446
}
14511447

modules/swagger-core/src/main/java/io/swagger/v3/core/util/Callback31Deserializer.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
package io.swagger.v3.core.util;
22

3-
import com.fasterxml.jackson.core.JsonParser;
4-
import com.fasterxml.jackson.databind.DeserializationContext;
5-
import com.fasterxml.jackson.databind.JsonDeserializer;
6-
import com.fasterxml.jackson.databind.JsonNode;
7-
import com.fasterxml.jackson.databind.node.ObjectNode;
8-
import io.swagger.v3.oas.models.PathItem;
9-
10-
import javax.security.auth.callback.Callback;
11-
import java.io.IOException;
12-
import java.util.Iterator;
13-
import java.util.LinkedHashMap;
14-
import java.util.Map;
15-
163
public class Callback31Deserializer extends CallbackDeserializer {
174

185
public Callback31Deserializer() {

modules/swagger-core/src/test/java/io/swagger/v3/core/converting/ModelConverterTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ public void processModelWithPairProperties() {
182182
ModelConverters.getInstance().addConverter(asPropertyConverter);
183183
final Map<String, Schema> asProperty = readAll(ModelWithTuple2.class);
184184
ModelConverters.getInstance().removeConverter(asPropertyConverter);
185-
//assertEquals(asProperty.size(), 2);
186185
Map<String, Schema> values = asProperty.get("ModelWithTuple2").getProperties();
187186
Yaml.prettyPrint(values);
188187
for (Map.Entry<String, Schema> entry : values.entrySet()) {

modules/swagger-core/src/test/java/io/swagger/v3/core/converting/SwaggerSerializerTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ public void writeSpecWithParameterReferences() throws IOException {
159159
final OpenAPI swagger = new OpenAPI()
160160
.info(info)
161161
.addServersItem(new Server().url("http://petstore.swagger.io"))
162-
//.consumes("application/json")
163-
//.produces("application/json")
164162
.schema("Person", personModel);
165163

166164
final QueryParameter parameter = (QueryParameter) new QueryParameter()
@@ -169,10 +167,8 @@ public void writeSpecWithParameterReferences() throws IOException {
169167
.schema(new IntegerSchema());
170168

171169
final Operation get = new Operation()
172-
//.produces("application/json")
173170
.summary("finds pets in the system")
174171
.description("a longer description")
175-
//.tag("Pet Operations")
176172
.operationId("get pet by id")
177173
.addParametersItem(new Parameter().$ref("#/parameters/Foo"));
178174

modules/swagger-core/src/test/java/io/swagger/v3/core/converting/override/SnakeCaseConverterTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
import org.testng.annotations.Test;
1414

1515
import javax.xml.bind.annotation.XmlRootElement;
16-
import java.lang.annotation.Annotation;
17-
import java.lang.reflect.Type;
1816
import java.util.Iterator;
1917
import java.util.LinkedHashMap;
2018
import java.util.Map;
2119
import java.util.Set;
22-
import java.util.function.BiFunction;
2320

2421
import static io.swagger.v3.core.util.RefUtils.constructRef;
2522
import static io.swagger.v3.core.util.RefUtils.extractSimpleName;

modules/swagger-core/src/test/java/io/swagger/v3/core/matchers/SerializationMatchers.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.swagger.v3.core.matchers;
22

3-
import com.fasterxml.jackson.core.JsonProcessingException;
43
import com.fasterxml.jackson.databind.JsonNode;
54
import com.fasterxml.jackson.databind.ObjectMapper;
65
import com.fasterxml.jackson.databind.node.NumericNode;
@@ -46,7 +45,6 @@ private static void apply(Object objectToSerialize, String str, ObjectMapper map
4645
}
4746
if (!lhs.equals(new ObjectNodeComparator(), rhs)) {
4847
assertEquals(Yaml.pretty(lhs), Yaml.pretty(rhs));
49-
//fail(String.format("Serialized object:\n%s\ndoes not equal to expected serialized string:\n%s", lhs, rhs));
5048
}
5149
}
5250

@@ -60,7 +58,6 @@ private static void apply31(Object objectToSerialize, String str, ObjectMapper m
6058
}
6159
if (!lhs.equals(new ObjectNodeComparator(), rhs)) {
6260
assertEquals(Yaml31.pretty(lhs), Yaml31.pretty(rhs));
63-
//fail(String.format("Serialized object:\n%s\ndoes not equal to expected serialized string:\n%s", lhs, rhs));
6461
}
6562
}
6663

0 commit comments

Comments
 (0)