@@ -161,7 +161,7 @@ private void updateApiResponse(OpenAPI openAPI, Components components, ApiRespon
161161 apiResponse .getContent ().values ().forEach (mediaType -> {
162162 Schema schema = mediaType .getSchema ();
163163 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 () );
165165 Set <String > entitiesNames = entityInoMap .keySet ();
166166 entitiesNames .forEach (entityName -> {
167167 if (key .endsWith (entityName ))
@@ -184,7 +184,7 @@ private void updateRequestBody(OpenAPI openAPI, RequestBody requestBody, boolean
184184 requestBody .getContent ().values ().forEach (mediaType -> {
185185 Schema schema = mediaType .getSchema ();
186186 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 () );
188188 if (entityInoMap .containsKey (key ))
189189 updateRequestBodySchema (key , schema , openAPI .getComponents (), openapi31 );
190190 }
@@ -285,7 +285,7 @@ private void updateResponseSchemaEmbedded(Components components, EntityInfo enti
285285 Schema itemsSchema = arraySchema .getItems ();
286286 Set <String > entitiesNames = entityInoMap .keySet ();
287287 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 () );
289289 if (entitiesNames .contains (key )) {
290290 String newKey = itemsSchema .get$ref () + RESPONSE ;
291291 createNewResponseSchema (key , components , openapi31 );
@@ -380,7 +380,7 @@ private void updateKey(List<Schema> allSchemas, String suffix, Components compon
380380 if (!CollectionUtils .isEmpty (allSchemas ))
381381 for (Schema allSchema : allSchemas ) {
382382 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 () );
384384 updateSingleKey (suffix , components , allSchema , allKey , openapi31 );
385385 }
386386 }
0 commit comments