Skip to content

Commit 81939a0

Browse files
committed
Add support for add/remove tag
1 parent f58c126 commit 81939a0

File tree

8 files changed

+55
-6
lines changed

8 files changed

+55
-6
lines changed

ramls/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ schemalint:
1818
z-schema set-schema.json
1919
z-schema sets-schema.json
2020
z-schema retrieve-schema.json
21-
z-schema addremove-schema.json
21+
z-schema addremoveobjects-schema.json
22+
z-schema addremovetag-schema.json
2223

2324
examplelint:
2425
z-schema tag-schema.json examples/tag-example.json
@@ -28,8 +29,10 @@ examplelint:
2829
z-schema set-schema.json examples/set-example.json
2930
z-schema sets-schema.json examples/sets-example.json
3031
z-schema retrieve-schema.json examples/retrieve-example.json
31-
z-schema addremove-schema.json examples/add-example.json
32-
z-schema addremove-schema.json examples/remove-example.json
32+
z-schema addremoveobjects-schema.json examples/addobject-example.json
33+
z-schema addremoveobjects-schema.json examples/removeobject-example.json
34+
z-schema addremovetag-schema.json examples/addtag-example.json
35+
z-schema addremovetag-schema.json examples/removetag-example.json
3336

3437
apilint: cyclops.raml
3538
env PATH=$(VENV)/bin:$$PATH api_lint.py -t RAML -d .

ramls/addremovetag-schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"description": "A request to add a tag to, or remove a tag from from, objects within a set",
4+
"type": "object",
5+
"properties": {
6+
"op": {
7+
"type": "string",
8+
"description": "Operation to perform: add or remove",
9+
"enum": ["add", "remove"]
10+
},
11+
"cond": {
12+
"type": "string",
13+
"description": "An SQL-like WHERE condition specifying the selection of records included in the operation"
14+
},
15+
"filter": {
16+
"type": "string",
17+
"description": "The name of a filter to be applied to selection of records included in the operation"
18+
}
19+
},
20+
"additionalProperties": false,
21+
"required": [
22+
"op"
23+
]
24+
}

ramls/cyclops.raml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,27 @@ documentation:
119119
description: "add objects to, or remove objects from, a set"
120120
body:
121121
application/json:
122-
type: !include addremove-schema.json
122+
type: !include addremoveobjects-schema.json
123123
examples:
124124
add:
125-
value: !include examples/add-example.json
125+
value: !include examples/addobject-example.json
126126
remove:
127-
value: !include examples/remove-example.json
127+
value: !include examples/removeobject-example.json
128128
responses:
129129
204:
130130
description: No content is returned.
131131
/tag:
132132
/{tagName}:
133133
post:
134+
description: "add tag to, or remove tag from, objects within in a set"
135+
body:
136+
application/json:
137+
type: !include addremovetag-schema.json
138+
examples:
139+
add:
140+
value: !include examples/addtag-example.json
141+
remove:
142+
value: !include examples/removetag-example.json
143+
responses:
144+
204:
145+
description: No content is returned.

ramls/examples/addtag-example.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"op": "add",
3+
"cond": "title LIKE \"%saur\"",
4+
"filter": "ptero"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"op": "remove",
3+
"cond": "author LIKE \"%taylor%\"",
4+
"filter": "dino"
5+
}

0 commit comments

Comments
 (0)