refactor: swagger 导入弃用接口打上Deleted标签
This commit is contained in:
parent
64d9c00b01
commit
8022cc509a
|
@ -84,6 +84,9 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
||||||
apiDefinition.setRequest(JSON.toJSONString(request));
|
apiDefinition.setRequest(JSON.toJSONString(request));
|
||||||
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation, operation.getResponses())));
|
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation, operation.getResponses())));
|
||||||
buildModule(selectModule, apiDefinition, operation.getTags(), selectModulePath);
|
buildModule(selectModule, apiDefinition, operation.getTags(), selectModulePath);
|
||||||
|
if (operation.isDeprecated() != null && operation.isDeprecated()) {
|
||||||
|
apiDefinition.setTags("[\"Deleted\"]");
|
||||||
|
}
|
||||||
results.add(apiDefinition);
|
results.add(apiDefinition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
|
||||||
apiDefinition.setRequest(JSON.toJSONString(request));
|
apiDefinition.setRequest(JSON.toJSONString(request));
|
||||||
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation.getResponses())));
|
apiDefinition.setResponse(JSON.toJSONString(parseResponse(operation.getResponses())));
|
||||||
buildModule(selectModule, apiDefinition, operation.getTags(), selectModulePath);
|
buildModule(selectModule, apiDefinition, operation.getTags(), selectModulePath);
|
||||||
|
if (operation.getDeprecated() != null && operation.getDeprecated()) {
|
||||||
|
apiDefinition.setTags("[\"Deleted\"]");
|
||||||
|
}
|
||||||
results.add(apiDefinition);
|
results.add(apiDefinition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue