forked from techatpark/zols
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic.http
148 lines (139 loc) · 3.34 KB
/
basic.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
@base = http://localhost:8080
#### Index a document with Id
POST {{base}}/api/schema
Content-Type: application/json
{
"$id": "geo",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Geographical Coordinate",
"description": "A geographical coordinate",
"type": "object",
"properties": {
"latitude": { "type": "number" },
"longitude": { "type": "number" }
}
}
#### Index a document with Id
POST {{base}}/api/schema
Content-Type: application/json
{
"$id":"seller",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Seller",
"description": "A seller from Acme's catalog",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a seller",
"type": "integer"
},
"name": {
"description": "Name of the product",
"type": "string"
}
},
"required": ["id", "name"],
"localized": ["name"]
}
#### Index a document with Id
POST {{base}}/api/schema
Content-Type: application/json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"localized": [
"title"
],
"description": "A product from Acme's catalog",
"ids": [
"id"
],
"label": "price",
"title": "Product",
"type": "object",
"properties": {
"warehouseLocations": {
"description": "Coordinates of the warehouse with the product",
"title": "Warehouse Locations",
"type": "array",
"items": {
"$ref": "geo"
}
},
"price": {
"filter": "minmax",
"type": "number",
"exclusiveMinimum": 0,
"title": "Price"
},
"imageUrl": {
"description": "Image of the product",
"type": "string",
"title": "Image"
},
"prefererredSeller": {
"title": "Preferred Seller",
"$ref": "seller"
},
"id": {
"description": "The unique identifier for a product",
"type": "integer",
"title": "Id"
},
"title": {
"description": "Name of the product",
"type": "string",
"title": "Title"
},
"sellers": {
"title": "Sellers",
"type": "array",
"items": {
"$ref": "seller"
}
},
"tags": {
"filter": "term",
"minItems": 1,
"uniqueItems": true,
"type": "array",
"title": "Tags",
"items": {
"type": "string"
}
}
},
"required": [
"price",
"id",
"title"
],
"$id": "product"
}
#### Index a document without Id
POST {{base}}/api/data/product
Content-Type: application/json
{
"id": 4,
"title": "343434343 Laptop",
"imageUrl": "https://www.reliancedigital.in/medias/HP-14s-DQ2101TU-Laptops-491996532-i-1-1200Wx1200H-96Wx96H?context=bWFzdGVyfGltYWdlc3wyMzYzOXxpbWFnZS9qcGVnfGltYWdlcy9oMjUvaGI3Lzk1NDY2NDAwOTczMTAuanBnfDIxODdmYTBhNGQxOWZhZmVlOTFlMmVjZmNmYjZjNTkwODY1MTE3NGE5Nzg1NmM3ZGI4YWViMGVmNmQ2MGExMmE",
"price": 12.50,
"tags": ["Official", "Electronics"],
"sellers": [{
"id": 1,
"name": "HP Showroom"
}, {
"id": 2,
"name": "More Showroom"
}],
"prefererredSeller": {
"id": 3,
"name": "Muthu"
},
"warehouseLocations": [{
"latitude": 1,
"longitude": 2
}]
}
#### Get Mapping
GET {{base}}/api/schema/product
Content-Type: application/json