swagger-api / swagger-play

Apache License 2.0
330 stars 181 forks source link

Do not default operation id to controller method name. #184

Open jaapterwoerds opened 5 years ago

jaapterwoerds commented 5 years ago

Fixes #181

gaeljw commented 4 years ago

According to OAS, the operationId should be:

Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is case-sensitive. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.

Thus I don't think setting to null by default would be a good idea.

Moreover, even though it's "implementation detail" the method name should convey at least a bit of information that null won't convey at all.

That being said, I realize that controller method name is not guaranteed to be unique but it has a limited risk of duplicates. Maybe one improvement would be to prefix it with the controller name itself.