Skip to content

Commit 962eb64

Browse files
committed
Do not use x-spotify-docs-type to get type
1 parent c47454a commit 962eb64

File tree

1 file changed

+3
-12
lines changed
  • spotify-web-api-java-generator/src/main/java/de/sonallux/spotify/generator/java/util

1 file changed

+3
-12
lines changed

spotify-web-api-java-generator/src/main/java/de/sonallux/spotify/generator/java/util/JavaUtils.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ public static Optional<String> getTypeOfSchema(Schema<?> schema) {
9595
return getTypeOfSchema(itemsSchema.getItems())
9696
.map(itemsType -> "Paging<" + itemsType + ">");
9797
}
98-
99-
//return getTypeOfSchema(allOf.get(0));
10098
}
10199
if (allOf.size() == 2) {
102100
if (allOf.get(0).get$ref().equals("#/components/schemas/PagingObject")) {
@@ -123,22 +121,15 @@ public static Optional<String> getTypeOfSchema(Schema<?> schema) {
123121
}
124122
}
125123

126-
if (schema.getExtensions() != null) {
127-
return Optional.ofNullable((String) schema.getExtensions().get("x-spotify-docs-type"))
128-
.map(type -> type.replace("Object", ""));
129-
}
130-
}
131-
132-
if (schema.getExtensions() != null) {
133-
return Optional.ofNullable((String) schema.getExtensions().get("x-spotify-docs-type"))
134-
.map(type -> type.replace("Object", ""));
124+
// Resolve type of other composed schema via reference name
125+
return Optional.empty();
135126
}
136127

137128
if (schema instanceof MapSchema) {
138129
return Optional.of("java.util.Map<String, Object>");
139130
}
140131

141-
log.warn("Can not get type for schema type: " + schema.getType());
132+
// Type can not be resolved just by schema
142133
return Optional.empty();
143134
}
144135

0 commit comments

Comments
 (0)