mapstruct 和 OpenAPI 的错误元素错误

Erroneous element error with mapstruct and OpenAPI

尝试使用 MapStruct 转换由 openapi-generator 生成的 java 模型时出现以下异常

error: No implementation was created for EmployeeMapper due to having a problem in the erroneous element org.openapitools.jackson.nullable.JsonNullable. Hint: this often means that some other annotation processor was supposed to process the erroneous element. You can also enable MapStruct verbose mode by setting -Amapstruct.verbose=true as a compilation argument.

问题是生成的 java 文件具有未使用的导入

org.openapitools.jackson.nullable.JsonNullable 

因此在使用 openapi-generator 生成代码时传递了以下配置以忽略 JsonNullable 导入。

"openApiNullable": false