1
+ {
2
+ "$schema" : " http://json-schema.org/draft-07/schema#" ,
3
+ "title" : " Newznab API Combined Response Schema" ,
4
+ "description" : " This schema validates responses from the newznab API, including CAPS, REGISTER, SEARCH, TV-SEARCH, MOVIE-SEARCH, DETAILS, and Error responses." ,
5
+ "oneOf" : [
6
+ { "$ref" : " #/definitions/CAPSResponse" },
7
+ { "$ref" : " #/definitions/RegisterResponse" },
8
+ { "$ref" : " #/definitions/SearchResponse" },
9
+ { "$ref" : " #/definitions/TVSearchResponse" },
10
+ { "$ref" : " #/definitions/MovieSearchResponse" },
11
+ { "$ref" : " #/definitions/DetailsResponse" },
12
+ { "$ref" : " #/definitions/ErrorResponse" }
13
+ ],
14
+ "definitions" : {
15
+ "CAPSResponse" : {
16
+ "type" : " object" ,
17
+ "properties" : {
18
+ "caps" : {
19
+ "type" : " object" ,
20
+ "properties" : {
21
+ "server" : {
22
+ "type" : " object" ,
23
+ "properties" : {
24
+ "version" : { "type" : " string" },
25
+ "title" : { "type" : " string" },
26
+ "strapline" : { "type" : " string" },
27
+ "email" : { "type" : " string" , "format" : " email" },
28
+ "url" : { "type" : " string" , "format" : " uri" },
29
+ "image" : { "type" : " string" , "format" : " uri" }
30
+ },
31
+ "required" : [" version" , " title" , " strapline" , " email" , " url" , " image" ]
32
+ },
33
+ "limits" : {
34
+ "type" : " object" ,
35
+ "properties" : {
36
+ "max" : { "type" : " integer" },
37
+ "default" : { "type" : " integer" }
38
+ },
39
+ "required" : [" max" , " default" ]
40
+ },
41
+ "retention" : {
42
+ "type" : " object" ,
43
+ "properties" : {
44
+ "days" : { "type" : " integer" }
45
+ },
46
+ "required" : [" days" ]
47
+ },
48
+ "registration" : {
49
+ "type" : " object" ,
50
+ "properties" : {
51
+ "available" : { "type" : " string" , "enum" : [" yes" , " no" ] },
52
+ "open" : { "type" : " string" , "enum" : [" yes" , " no" ] }
53
+ },
54
+ "required" : [" available" , " open" ]
55
+ },
56
+ "searching" : {
57
+ "type" : " object" ,
58
+ "properties" : {
59
+ "search" : {
60
+ "type" : " object" ,
61
+ "properties" : {
62
+ "available" : { "type" : " string" , "enum" : [" yes" , " no" ] },
63
+ "supportedParams" : { "type" : " string" }
64
+ },
65
+ "required" : [" available" , " supportedParams" ]
66
+ },
67
+ "tv-search" : {
68
+ "type" : " object" ,
69
+ "properties" : {
70
+ "available" : { "type" : " string" , "enum" : [" yes" , " no" ] },
71
+ "supportedParams" : { "type" : " string" }
72
+ },
73
+ "required" : [" available" , " supportedParams" ]
74
+ },
75
+ "movie-search" : {
76
+ "type" : " object" ,
77
+ "properties" : {
78
+ "available" : { "type" : " string" , "enum" : [" yes" , " no" ] },
79
+ "supportedParams" : { "type" : " string" }
80
+ },
81
+ "required" : [" available" , " supportedParams" ]
82
+ },
83
+ "audio-search" : {
84
+ "type" : " object" ,
85
+ "properties" : {
86
+ "available" : { "type" : " string" , "enum" : [" yes" , " no" ] },
87
+ "supportedParams" : { "type" : " string" }
88
+ },
89
+ "required" : [" available" , " supportedParams" ]
90
+ }
91
+ },
92
+ "required" : [" search" , " tv-search" , " movie-search" , " audio-search" ]
93
+ },
94
+ "categories" : {
95
+ "type" : " object" ,
96
+ "properties" : {
97
+ "category" : {
98
+ "type" : " array" ,
99
+ "items" : {
100
+ "type" : " object" ,
101
+ "properties" : {
102
+ "id" : { "type" : " string" },
103
+ "name" : { "type" : " string" },
104
+ "description" : { "type" : " string" },
105
+ "subcat" : {
106
+ "type" : " array" ,
107
+ "items" : {
108
+ "type" : " object" ,
109
+ "properties" : {
110
+ "id" : { "type" : " string" },
111
+ "name" : { "type" : " string" },
112
+ "description" : { "type" : " string" }
113
+ },
114
+ "required" : [" id" , " name" ]
115
+ }
116
+ }
117
+ },
118
+ "required" : [" id" , " name" ]
119
+ }
120
+ }
121
+ },
122
+ "required" : [" category" ]
123
+ }
124
+ },
125
+ "required" : [
126
+ " server" ,
127
+ " limits" ,
128
+ " retention" ,
129
+ " registration" ,
130
+ " searching" ,
131
+ " categories"
132
+ ]
133
+ }
134
+ },
135
+ "required" : [" caps" ]
136
+ },
137
+ "RegisterResponse" : {
138
+ "oneOf" : [
139
+ {
140
+ "type" : " object" ,
141
+ "properties" : {
142
+ "register" : {
143
+ "type" : " object" ,
144
+ "properties" : {
145
+ "username" : { "type" : " string" },
146
+ "password" : { "type" : " string" },
147
+ "apikey" : { "type" : " string" }
148
+ },
149
+ "required" : [" username" , " password" , " apikey" ]
150
+ }
151
+ },
152
+ "required" : [" register" ]
153
+ },
154
+ { "$ref" : " #/definitions/ErrorResponse" }
155
+ ]
156
+ },
157
+ "SearchResponse" : {
158
+ "oneOf" : [
159
+ {
160
+ "type" : " object" ,
161
+ "properties" : {
162
+ "channel" : {
163
+ "type" : " object" ,
164
+ "properties" : {
165
+ "title" : { "type" : " string" },
166
+ "description" : { "type" : " string" },
167
+ "response" : {
168
+ "type" : " object" ,
169
+ "properties" : {
170
+ "offset" : { "type" : " integer" },
171
+ "total" : { "type" : " integer" }
172
+ },
173
+ "required" : [" offset" , " total" ]
174
+ },
175
+ "item" : {
176
+ "type" : " array" ,
177
+ "items" : { "$ref" : " #/definitions/Item" }
178
+ }
179
+ },
180
+ "required" : [" title" , " description" , " response" ]
181
+ }
182
+ },
183
+ "required" : [" channel" ]
184
+ },
185
+ { "$ref" : " #/definitions/ErrorResponse" }
186
+ ]
187
+ },
188
+ "TVSearchResponse" : {
189
+ "oneOf" : [
190
+ {
191
+ "type" : " object" ,
192
+ "properties" : {
193
+ "channel" : {
194
+ "type" : " object" ,
195
+ "properties" : {
196
+ "title" : { "type" : " string" },
197
+ "description" : { "type" : " string" },
198
+ "response" : {
199
+ "type" : " object" ,
200
+ "properties" : {
201
+ "offset" : { "type" : " integer" },
202
+ "total" : { "type" : " integer" }
203
+ },
204
+ "required" : [" offset" , " total" ]
205
+ },
206
+ "item" : {
207
+ "type" : " array" ,
208
+ "items" : { "$ref" : " #/definitions/Item" }
209
+ }
210
+ },
211
+ "required" : [" title" , " description" , " response" ]
212
+ }
213
+ },
214
+ "required" : [" channel" ]
215
+ },
216
+ { "$ref" : " #/definitions/ErrorResponse" }
217
+ ]
218
+ },
219
+ "MovieSearchResponse" : {
220
+ "oneOf" : [
221
+ {
222
+ "type" : " object" ,
223
+ "properties" : {
224
+ "channel" : {
225
+ "type" : " object" ,
226
+ "properties" : {
227
+ "title" : { "type" : " string" },
228
+ "description" : { "type" : " string" },
229
+ "response" : {
230
+ "type" : " object" ,
231
+ "properties" : {
232
+ "offset" : { "type" : " integer" },
233
+ "total" : { "type" : " integer" }
234
+ },
235
+ "required" : [" offset" , " total" ]
236
+ },
237
+ "item" : {
238
+ "type" : " array" ,
239
+ "items" : { "$ref" : " #/definitions/Item" }
240
+ }
241
+ },
242
+ "required" : [" title" , " description" , " response" ]
243
+ }
244
+ },
245
+ "required" : [" channel" ]
246
+ },
247
+ { "$ref" : " #/definitions/ErrorResponse" }
248
+ ]
249
+ },
250
+ "DetailsResponse" : {
251
+ "oneOf" : [
252
+ {
253
+ "type" : " object" ,
254
+ "properties" : {
255
+ "channel" : {
256
+ "type" : " object" ,
257
+ "properties" : {
258
+ "item" : { "$ref" : " #/definitions/Item" }
259
+ },
260
+ "required" : [" item" ]
261
+ }
262
+ },
263
+ "required" : [" channel" ]
264
+ },
265
+ { "$ref" : " #/definitions/ErrorResponse" }
266
+ ]
267
+ },
268
+ "ErrorResponse" : {
269
+ "type" : " object" ,
270
+ "properties" : {
271
+ "error" : {
272
+ "type" : " object" ,
273
+ "properties" : {
274
+ "code" : { "type" : " string" },
275
+ "description" : { "type" : " string" }
276
+ },
277
+ "required" : [" code" , " description" ]
278
+ }
279
+ },
280
+ "required" : [" error" ]
281
+ },
282
+ "Item" : {
283
+ "type" : " object" ,
284
+ "properties" : {
285
+ "title" : { "type" : " string" },
286
+ "guid" : { "type" : " string" },
287
+ "link" : { "type" : " string" , "format" : " uri" },
288
+ "comments" : { "type" : " string" , "format" : " uri" },
289
+ "pubDate" : { "type" : " string" },
290
+ "category" : { "type" : " string" },
291
+ "description" : { "type" : " string" },
292
+ "enclosure" : {
293
+ "type" : " object" ,
294
+ "properties" : {
295
+ "url" : { "type" : " string" , "format" : " uri" },
296
+ "length" : { "type" : " string" },
297
+ "type" : { "type" : " string" }
298
+ },
299
+ "required" : [" url" , " length" , " type" ]
300
+ },
301
+ "attr" : {
302
+ "type" : " array" ,
303
+ "items" : { "$ref" : " #/definitions/Attribute" }
304
+ }
305
+ },
306
+ "required" : [" title" , " guid" , " link" , " pubDate" , " category" , " enclosure" ]
307
+ },
308
+ "Attribute" : {
309
+ "type" : " object" ,
310
+ "properties" : {
311
+ "name" : { "type" : " string" },
312
+ "value" : { "type" : " string" }
313
+ },
314
+ "required" : [" name" , " value" ]
315
+ }
316
+ }
317
+ }
318
+
0 commit comments