refactor: swagger 导入弃用接口打上Deleted标签

This commit is contained in:
chenjianxing 2021-09-06 15:07:09 +08:00 committed by jianxing
parent 64d9c00b01
commit 8022cc509a
2 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,9 @@ public class Swagger2Parser extends SwaggerAbstractParser {
apiDefinition.setRequest(JSON.toJSONString(request));
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation, operation.getResponses())));
buildModule(selectModule, apiDefinition, operation.getTags(), selectModulePath);
if (operation.isDeprecated() != null && operation.isDeprecated()) {
apiDefinition.setTags("[\"Deleted\"]");
}
results.add(apiDefinition);
}
}

View File

@ -119,6 +119,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
apiDefinition.setRequest(JSON.toJSONString(request));
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation.getResponses())));
buildModule(selectModule, apiDefinition, operation.getTags(), selectModulePath);
if (operation.getDeprecated() != null && operation.getDeprecated()) {
apiDefinition.setTags("[\"Deleted\"]");
}
results.add(apiDefinition);
}
}