Skip to content

Commit

Permalink
REST: Add operationIds to OpenAPI schema
Browse files Browse the repository at this point in the history
The `operationId` field is used by API client generators to generate
better method names.

Change-Id: I2acf90af3b9504c3246cb6bb7801bb6ed3a9de3d
  • Loading branch information
jakobw committed Jul 26, 2023
1 parent 826a225 commit 59d432a
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemAliasesInLanguage",
"tags": [ "aliases" ],
"summary": "Retrieve an Item's aliases in a specific language",
"parameters": [
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/aliases/list.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemAliases",
"tags": [ "aliases" ],
"summary": "Retrieve an Item's aliases",
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemDescription",
"tags": [ "descriptions" ],
"summary": "Retrieve an Item's description in a specific language",
"parameters": [
Expand All @@ -22,6 +23,7 @@
}
},
"put": {
"operationId": "replaceItemDescription",
"tags": [ "descriptions" ],
"summary": "Add / Replace an Item's description in a specific language",
"parameters": [
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/items/single.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItem",
"tags": [ "items" ],
"summary": "Retrieve a single Wikibase Item by ID",
"parameters": [
Expand Down
2 changes: 2 additions & 0 deletions repo/rest-api/specs/resources/labels/label-in-language.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemLabel",
"tags": [ "labels" ],
"summary": "Retrieve an Item's label in a specific language",
"parameters": [
Expand All @@ -22,6 +23,7 @@
}
},
"put": {
"operationId": "replaceItemLabel",
"tags": [ "labels" ],
"summary": "Add / Replace an Item's label in a specific language",
"parameters": [
Expand Down
2 changes: 2 additions & 0 deletions repo/rest-api/specs/resources/labels/list.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemLabels",
"tags": [ "labels" ],
"summary": "Retrieve an Item's labels",
"parameters": [
Expand All @@ -21,6 +22,7 @@
}
},
"patch": {
"operationId": "patchItemLabels",
"tags": [ "labels" ],
"summary": "Change an Item's Labels",
"parameters": [
Expand Down
1 change: 1 addition & 0 deletions repo/rest-api/specs/resources/properties/single.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getPropertyStatement",
"tags": [ "properties" ],
"summary": "Retrieve a single Wikibase Property by ID",
"parameters": [
Expand Down
2 changes: 2 additions & 0 deletions repo/rest-api/specs/resources/statements/list-for-item.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemStatements",
"tags": [ "statements" ],
"summary": "Retrieve Statements from an Item",
"parameters": [
Expand All @@ -22,6 +23,7 @@
}
},
"post": {
"operationId": "addItemStatement",
"tags": [ "statements" ],
"summary": "Add a new Statement to an Item",
"parameters": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getPropertyStatements",
"tags": [ "statements" ],
"summary": "Retrieve Statements from a Property",
"parameters": [
Expand Down
4 changes: 4 additions & 0 deletions repo/rest-api/specs/resources/statements/single-for-item.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getItemStatement",
"tags": [
"statements"
],
Expand All @@ -24,6 +25,7 @@
}
},
"put": {
"operationId": "replaceItemStatement",
"tags": [ "statements" ],
"summary": "Replace a single Statement of an Item",
"description": "This endpoint is also accessible through `/statements/{statement_id}`",
Expand All @@ -45,6 +47,7 @@
}
},
"patch": {
"operationId": "patchItemStatement",
"tags": [ "statements" ],
"summary": "Change elements of a single Statement of an Item",
"description": "This endpoint is also accessible through `/statements/{statement_id}`.",
Expand All @@ -68,6 +71,7 @@
}
},
"delete": {
"operationId": "deleteItemStatement",
"tags": [ "statements" ],
"summary": "Delete a single Statement from an Item",
"description": "This endpoint is also accessible through `/statements/{statement_id}`",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getPropertyStatement",
"tags": [
"statements"
],
Expand Down
4 changes: 4 additions & 0 deletions repo/rest-api/specs/resources/statements/single.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"get": {
"operationId": "getStatement",
"tags": [
"statements"
],
Expand All @@ -23,6 +24,7 @@
}
},
"put": {
"operationId": "replaceStatement",
"tags": [ "statements" ],
"summary": "Replace a single Statement",
"description": "This endpoint is also accessible through `/entities/items/{item_id}/statements/{statement_id}`",
Expand All @@ -43,6 +45,7 @@
}
},
"patch": {
"operationId": "patchStatement",
"tags": [ "statements" ],
"summary": "Change elements of a single Statement",
"description": "This endpoint is also accessible through `/entities/items/{item_id}/statements/{statement_id}`",
Expand All @@ -65,6 +68,7 @@
}
},
"delete": {
"operationId": "deleteStatement",
"tags": [ "statements" ],
"summary": "Delete a single Statement",
"description": "This endpoint is also accessible through `/entities/items/{item_id}/statements/{statement_id}`",
Expand Down

0 comments on commit 59d432a

Please sign in to comment.