Description
Each operationId you define must be unique across the API, including operations on different HTTP methods.
Potential impact
Duplicate IDs can generate conflicting SDK method names or send a link to the wrong operation.
Remediation
Name each operation for what it does. If you rename an ID, update links and automation that use it and regenerate affected clients.
Examples
The example gives GET and POST distinct IDs, listRootResource and createRootResource. Supply info and the required responses for each operation.
Before
json
{
"openapi": "3.0.0",
"paths": {
"/": {
"get": {
"operationId": "operation_id"
},
"post": {
"operationId": "operation_id"
}
}
}
}
After
json
{
"openapi": "3.0.0",
"paths": {
"/": {
"get": {
"operationId": "listRootResource"
},
"post": {
"operationId": "createRootResource"
}
}
}
}