【发布时间】:2020-10-23 20:04:53
【问题描述】:
我用 openapi-codegen 创建了一个 rest-api。作为参数,有一个包含两个 ENUM 的对象。
例如
public enum DocumentType {
FOTO_ID("PHOTO_ID");
[...]
}
如果我使用“PHOTO_ID”以外的 DocumentType 发送请求,我会收到以下响应
Cannot construct instance of `[...]`, problem: Unexpected value '[...]'
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 2, column: 21] (through reference chain: [...])
这是正确的,但我想抓住它并发送我自己的错误响应。
我找不到这样做的方法。
【问题讨论】:
标签: jackson openapi swagger-codegen