3

Using openapi-generator to generate a C# API client using an openapi v3.0 specification. Is there a way to customize the methodNames of the API? I'd prefer to be able to specify them maybe by using operationId field?

Right now they are incorporating the path variables along with the HTTP VERB and the static path components. It'll work, but I'd like the names to be a bit different.

GetEncountersResponse ClientidEncountersDateGet (string clientid, string date, string startToken = null);

The other option is to just add new methods since the class is defined as partial?

4

1 回答 1

3

Right now they are incorporating the path variables along with the HTTP VERB and the static path components. It'll work, but I'd like the names to be a bit different.

Looks like the operationId (optional) is missing in the operation (endpoint) defined in the OpenAPI doc/spec and that's why the method name is auto-generated based on the path, HTTP verb, etc.

You can define the operationId to have better control of the method name.

于 2019-06-05T17:48:04.493 回答