Skip to content

Commit

Permalink
feat: REST patch relation tuples (#491)
Browse files Browse the repository at this point in the history
The new PATCH handler allows transactional changes similar to the already existing gRPC service.
  • Loading branch information
zepatrik authored Mar 17, 2021
1 parent 91a3cf4 commit d38618a
Show file tree
Hide file tree
Showing 10 changed files with 964 additions and 3 deletions.
141 changes: 141 additions & 0 deletions .schema/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,133 @@
}
}
}
},
"patch": {
"description": "Patch multiple relation tuples",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
],
"tags": [
"write"
],
"operationId": "patchRelationTuples",
"parameters": [
{
"name": "Payload",
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/PatchDelta"
}
}
}
],
"responses": {
"204": {
"description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201."
},
"400": {
"description": "The standard error format",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"request": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"404": {
"description": "The standard error format",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"request": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"500": {
"description": "The standard error format",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int64"
},
"details": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"request": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
}
}
}
},
"/version": {
Expand Down Expand Up @@ -855,6 +982,17 @@
}
}
},
"PatchDelta": {
"type": "object",
"properties": {
"action": {
"$ref": "#/definitions/patchAction"
},
"relation_tuple": {
"$ref": "#/definitions/InternalRelationTuple"
}
}
},
"expandTree": {
"type": "object",
"required": [
Expand Down Expand Up @@ -934,6 +1072,9 @@
}
}
},
"patchAction": {
"type": "string"
},
"subject": {
"type": "string"
},
Expand Down
148 changes: 148 additions & 0 deletions internal/httpclient/client/write/patch_relation_tuples_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d38618a

Please sign in to comment.