refactor: corrects operationIds in ewm service specs #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisite: It is highly recommended to merge #22 changes, since generation via swagger-codegen-maven-plugin does not work correctly for original ewm-main-service-spec.json file.
In case of code generation via swagger-codegen-maven-plugin there are several problems with
operationId
s provided in ewm-main-service-spec.json file (see demo pom.xml in terekhovmv@da018e0).operationId
s contain numeric suffixes, and this suffixes appear in methods of generated*Api
interfaces (getEvents_2
,getEvent_1
). Solution: remove suffixes at least.delete
/deleteCompilation
,registerUser
/addEvent
/saveCompilation
). Solution: provide consistent naming.*Api
interfaces are generated for top level endpoint components (/users/*
=>UsersApi
) there are problems with identifying endpoint methods for different roles (e.g.cancelRequest
andchangeRequestStatus
in theUsersApi
interface). Solution: put the role as prefix inoperationId
s.operationId
s must be unique among all operations described in your API (see https://swagger.io/docs/specification/paths-and-operations/), we should provide enough global descriptive names (delete
orgetEvent_1
does not work).Tabular view of changes proposed in this PR:
GET /categories
getCategories
getCategories
(no changes)GET /categories/{catId}
getCategory
getCategory
(no changes)GET /compilations
getCompilations
getCompilations
(no changes)GET /compilations/{compId}
getCompilation
getCompilation
(no changes)GET /events
getEvents_1
findEvents
GET /events/{id}
getEvent_1
getEvent
GET /admin/users
getUsers
adminGetUsers
POST /admin/users
registerUser
adminAddUser
DELETE /admin/users/{userId}
delete
adminRemoveUser
POST /admin/categories
addCategory
adminAddCategory
DELETE /admin/categories/{catId}
deleteCategory
adminRemoveCategory
PATCH /admin/categories/{catId}
updateCategory
adminUpdateCategory
GET /admin/events
getEvents_2
adminFindEvents
PATCH /admin/events/{eventId}
updateEvent_1
adminUpdateEvent
POST /admin/compilations
saveCompilation
adminAddCompilation
DELETE /admin/compilations/{compId}
deleteCompilation
adminRemoveCompilation
PATCH /admin/compilations/{compId}
updateCompilation
adminUpdateCompilation
GET /users/{userId}/events
getEvents
initiatorGetEvents
GET /users/{userId}/events/{eventId}
getEvents
initiatorGetEvent
POST /users/{userId}/events
addEvent
initiatorAddEvent
PATCH /users/{userId}/events/{eventId}
updateEvent
initiatorUpdateEvent
GET /users/{userId}/events/{eventId}/requests
getEventParticipants
initiatorGetEventRequests
PATCH /users/{userId}/events/{eventId}/requests
changeRequestStatus
initiatorChangeRequestStatus
GET /users/{userId}/requests
getUserRequests
participantGetRequests
POST /users/{userId}/requests
addParticipationRequest
participantAddRequest
PATCH /users/{userId}/requests/{requestId}/cancel
cancelRequest
participantCancelRequest