OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
I.e. the field parameter is missing in the construction. In practice this means, the error message is empty and the message string is set on the field attribute of the error.
openapi-generator version
5.1.1 locally and also on current main.
Suggest a fix
RequiredError should get two parameters method and field. The error message can then be generated at a single point. As a bonus the API name can also be included as a prefix in the method parameter.
Bug Report Checklist
Description
The
RequiredError
in the typescript generated code looks like this:Cf. https://github.com/OpenAPITools/openapi-generator/blob/master/samples/openapi3/client/petstore/typescript/builds/default/apis/baseapi.ts#L32-L37
It is used like this though:
Cf. https://github.com/OpenAPITools/openapi-generator/blob/master/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts#L29
I.e. the
field
parameter is missing in the construction. In practice this means, the error message is empty and the message string is set on the field attribute of the error.openapi-generator version
5.1.1 locally and also on current main.
Suggest a fix
RequiredError
should get two parametersmethod
andfield
. The error message can then be generated at a single point. As a bonus the API name can also be included as a prefix in the method parameter.