@@ -161,7 +161,7 @@ private void updateApiResponse(OpenAPI openAPI, Components components, ApiRespon
161
161
apiResponse .getContent ().values ().forEach (mediaType -> {
162
162
Schema schema = mediaType .getSchema ();
163
163
if (schema .get$ref () != null && !schema .get$ref ().endsWith (RESPONSE )) {
164
- String key = schema .get$ref ().substring (21 );
164
+ String key = schema .get$ref ().substring (Components . COMPONENTS_SCHEMAS_REF . length () );
165
165
Set <String > entitiesNames = entityInoMap .keySet ();
166
166
entitiesNames .forEach (entityName -> {
167
167
if (key .endsWith (entityName ))
@@ -184,7 +184,7 @@ private void updateRequestBody(OpenAPI openAPI, RequestBody requestBody, boolean
184
184
requestBody .getContent ().values ().forEach (mediaType -> {
185
185
Schema schema = mediaType .getSchema ();
186
186
if (schema .get$ref () != null && !schema .get$ref ().endsWith (REQUEST_BODY )) {
187
- String key = schema .get$ref ().substring (21 );
187
+ String key = schema .get$ref ().substring (Components . COMPONENTS_SCHEMAS_REF . length () );
188
188
if (entityInoMap .containsKey (key ))
189
189
updateRequestBodySchema (key , schema , openAPI .getComponents (), openapi31 );
190
190
}
@@ -285,7 +285,7 @@ private void updateResponseSchemaEmbedded(Components components, EntityInfo enti
285
285
Schema itemsSchema = arraySchema .getItems ();
286
286
Set <String > entitiesNames = entityInoMap .keySet ();
287
287
if (itemsSchema .get$ref () != null && !itemsSchema .get$ref ().endsWith (RESPONSE )) {
288
- String key = itemsSchema .get$ref ().substring (21 );
288
+ String key = itemsSchema .get$ref ().substring (Components . COMPONENTS_SCHEMAS_REF . length () );
289
289
if (entitiesNames .contains (key )) {
290
290
String newKey = itemsSchema .get$ref () + RESPONSE ;
291
291
createNewResponseSchema (key , components , openapi31 );
@@ -380,7 +380,7 @@ private void updateKey(List<Schema> allSchemas, String suffix, Components compon
380
380
if (!CollectionUtils .isEmpty (allSchemas ))
381
381
for (Schema allSchema : allSchemas ) {
382
382
if (allSchema .get$ref () != null ) {
383
- String allKey = allSchema .get$ref ().substring (21 );
383
+ String allKey = allSchema .get$ref ().substring (Components . COMPONENTS_SCHEMAS_REF . length () );
384
384
updateSingleKey (suffix , components , allSchema , allKey , openapi31 );
385
385
}
386
386
}
0 commit comments