我应该如何编写一个方法签名,向服务器发出休息请求并返回 openapi 定义的反序列化主体和原始响应? openapi 规范操作对象位于:https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-Object,其中定义了 请求主体对象 和 定义请求正文和响应允许的数据类型(json 模式)的响应对象。
我的目标是使用此处的答案自动生成 java 客户端代码,该代码包装从客户端调用的任何 openapi api 服务器 api。不应该实现反序列化,我只对以下方法签名感兴趣:
public ApiResponseWithDeserializationSkipped post(
SingletonTrue: skipDeserilization,
Object contentType,
Object body) {
// implementation
}
public ApiResponseForTextPlain post(
SingletonFalse: skipDeserilization,
SingletonTextPlain contentType,
String body) {
// implementation
}
public ApiResponseForApplicationJson post(
SingletonFalse: skipDeserilization,
SingletonApplicationJson contentType,
Map<String, String> body) {
// implementation
}
public ApiResponseWithDeserializationSkipped post(
SingletonTrue: skipDeserilization,
Object contentType,
Object body) {
// implementation
}
public ApiResponseForTextPlain post(
SingletonFalse: skipDeserilization,
SingletonTextPlain contentType,
String textPlainBody) {
// implementation
}
public ApiResponseForApplicationJson post(
SingletonFalse: skipDeserilization,
SingletonApplicationJson contentType,
Map<String, String> applicationJsonBody) {
// implementation
}