International-Data-Spaces-Association / DataspaceConnector

This is an IDS Connector reference implementation.
Apache License 2.0
35 stars 28 forks source link

OpenAPI operation ids are incomprehensible #15

Open Mickeyrourkeske opened 3 years ago

Mickeyrourkeske commented 3 years ago

Describe the bug The openapi schema downloaded from the swagger-ui contains for each operation an operationId. For example the operationId for GET /api/rules/{id} is get and for GET /api/requests/{id} is get_1. This behaviour can be seen for all operations in the openapi description.

To Reproduce Download the openapi json from the swagger-ui

Expected behavior I would expected meaningfull names. E.g. for GET /api/rules/{id} maybe getRules and for GET /api/requests/{id} getRequests.

brianjahnke commented 3 years ago

Hi, the openapi schema is going to change/improve with version 5.1.2.

Regarding the operation ids: I am not sure this is something we can easily change. The operation id can be anything e.g. an UUID as long as its unique in the context of the schema. Also from a quick look in the spring-docs issues it seems the operation id is not guaranteed to be stable from generation to generation.

Maybe you could write a quick parser creating a unique name based on the method and path?