-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathopenapi.yaml
1028 lines (997 loc) · 35.8 KB
/
openapi.yaml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Codever API
description: API supporting the [www.codever.land](https://www.codever.dev)
contact:
name: Adrian Matei
url: https://github.com/adrianmatei-me
email: ama@codepedia.org
license:
name: License MIT
url: https://github.com/CodeverDotDev/codever/LICENSE
version: 2.0.0
servers:
- url: http://localhost:3000/api
description: Local server for development
- url: https://www.codever.dev/api
description: Main (production) server
tags:
- name: root
description: Used to mark the root endpoint
- name: version
description: Access to the project's version and gitSha1
- name: public-bookmarks
description: Access to public bookmarks
- name: personal-bookmarks
description: Operations performed on personal bookmarks
- name: user-data
description: Operations performed on user data
- name: helper
description: Helper endpoints/operations
paths:
/:
get:
description: message with link to Swagger docs
tags:
- root
responses:
200:
description: message with link to Swagger docs
content: {}
/version:
get:
description: displays the current version of the project (from package.json) and the gitSha1
tags:
- version
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
/public/bookmarks:
get:
summary: |
Returns list of public bookmarks filtered with query parameters. `page` and `limit` query parameters are used
for pagination - if missing default values are used.
tags:
- public-bookmarks
description: |
* if `q` param is present they are filtered by the query text contained in it. (takes precedence over `location`)
* if `location` param is present returns a list with one **public** bookmark with that URL
* else **defaults** to the latest added 100 public bookmarks
> The list is empty if not public bookmarks returned for filter
parameters:
- $ref: "#/components/parameters/searchTextQueryParam"
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
- $ref: "#/components/parameters/locationQueryParam"
responses:
200:
description: OK
$ref: '#/components/responses/BookmarkListResponse'
/public/users/{userId}/profile:
get:
summary: returns public profile data (user profile & top public tags ) for user
tags:
- public-user-data
parameters:
- $ref: "#/components/parameters/userIdPathParam"
- $ref: "#/components/parameters/limitQueryParam"
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
profile:
$ref: '#/components/schemas/UserProfile'
topUsedPublicTags:
type: array
items:
$ref: '#/components/schemas/TagCount'
/webpage-info/scrape:
get:
description: Returns web page info about the page scraped by `location`, `youtubeVideoId` or `stackoverflowQuestionId`
operationId: get-webpage-info
tags:
- helper
parameters:
- name: location
in: query
description: url of the page scraped for data - **this takes precedence over the other query params if present**
schema:
type: string
- name: youtubeVideoId
in: query
description: id of the youtube video - https://www.youtube.com/watch?v=**Emlc7mkZDQ4**
schema:
type: string
- name: stackoverflowQuestionId
in: query
description: id of the question from stackoverflow - https://stackoverflow.com/questions/**51391080**/handling-errors-in-express-async-middleware
schema:
type: string
responses:
200:
description: contains details about the web page, youtube video or stackoverflow question
content:
application/json:
schema:
$ref: '#/components/schemas/WebpageInfo'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/bookmarks:
get:
description: |
Returns list of user's bookmarks - might be filtered by query text (`q` with `limit`) > `location` > `orderBy parameters;
The parameters precedence is shown via **>**
`page` and `limit` query parameters are used for pagination - if missing default values are used.
operationId: get-personal-bookmarks
tags:
- personal-bookmarks
parameters:
- $ref: "#/components/parameters/userIdPathParam"
- $ref: "#/components/parameters/searchTextQueryParam"
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
- $ref: "#/components/parameters/locationQueryParam"
- name: orderBy
in: query
description: |
It is considered in the abscence of `q` or `location` parameters
Possible values:
* MOST_LIKES - personal bookmarks most liked by the community
* LAST_CREATED - personal bookmarks last added
* MOST_USED - personal bookmarks the user (owner) clicked the most
schema:
type: string
enum: [MOST_LIKES, LAST_CREATED, MOST_USED]
responses:
200:
description: list of user's bookmarks
$ref: '#/components/responses/BookmarkListResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
post:
description: Create new bookmark for user
operationId: create-bookmark
tags:
- personal-bookmarks
parameters:
- $ref: '#/components/parameters/userIdPathParam'
requestBody:
description: Bookmark json data
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Bookmark'
examples:
blog-article:
value:
name: Cleaner code in an Express REST API with unified error handling – CodepediaOrg
location: https://www.codepedia.org/ama/cleaner-code-in-expressjs-rest-api-with-custom-error-handling
language: en
tags: [nodejs, error-handling, expressjs]
publishedOn: 2019-12-02,
sourceCodeURL: https://github.com/CodeverDotDev/codever-api
description: Shows how you can make your backend ExpressJS REST API cleaner by using custom error handling middleware. Code snippets of before and after refactoring are presented to make the point
descriptionHtml: <p>Shows how you can make your backend ExpressJS REST API cleaner by using custom error handling middleware. Code snippets of before and after refactoring are presented to make the point</p>
userId: 4c617f2b-2bad-498b-a9c6-4e9a8c303798
public: true,
lastAccessedAt: 2020-02-15T20:42:19.297Z
likeCount: 0
stackoverflow-question:
value:
name: Create GUID / UUID in JavaScript?
location: https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
language: en
tags: [javascript, guid, uuid]
publishedOn: 2008-09-19
sourceCodeURL:
description: UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDentifier), according to [RFC 4122](https://www.ietf.org/rfc/rfc4122.txt), are identifiers with a certain uniqueness guarantee.\n\nThe best way to generate them, is to follow implementation instructions in the said RFC, use one of the many community vetted open source implementations.\n\nA popular Open Source tool for working with UUIDs in JavaScript is [node-uuid](https://github.com/kelektiv/node-uuid)\n\nNote that just randomly generating the identifiers byte by byte, or character by character, will not give you the same guarantees as a conforming implementation. Also, very important, systems working with compliant UUIDs may choose not to accept randomly generated ones, and many open source validators will actually check for a valid structure.\n\nAn UUID must have this format:\n```\nxxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx\n```\nWhere the M and N positions may only have certain values. At this time, the only valid values for M are 1, 2, 3, 4 and 5, so randomly generating that position would make most results unacceptable.
descriptionHtml: <p>UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDentifier), according to <a href=\"https://www.ietf.org/rfc/rfc4122.txt\">RFC 4122</a>, are identifiers with a certain uniqueness guarantee.</p>\n<p>The best way to generate them, is to follow implementation instructions in the said RFC, use one of the many community vetted open source implementations.</p>\n<p>A popular Open Source tool for working with UUIDs in JavaScript is <a href=\"https://github.com/kelektiv/node-uuid\">node-uuid</a></p>\n<p>Note that just randomly generating the identifiers byte by byte, or character by character, will not give you the same guarantees as a conforming implementation. Also, very important, systems working with compliant UUIDs may choose not to accept randomly generated ones, and many open source validators will actually check for a valid structure.</p>\n<p>An UUID must have this format:</p>\n<pre><code>xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx\n</code></pre>\n<p>Where the M and N positions may only have certain values. At this time, the only valid values for M are 1, 2, 3, 4 and 5, so randomly generating that position would make most results unacceptable.</p>
userId: 4c617f2b-2bad-498b-a9c6-4e9a8c303798
public: true
lastAccessedAt: 2020-02-15T20:59:45.447Z
likeCount: 0
stackoverflowQuestionId: 105034
youtube-video:
value:
name: Jake Archibald In The Loop - JSConf.Asia - 35min
location: https://www.youtube.com/watch?v=cCOL7MC4Pl0
language: en
tags: [javascript, event-loop, browser]
publishedOn: 2018-02-09
sourceCodeURL:
description: Have you ever had a bug where things were happening in the wrong order, or particular style changes were being ignored? Ever fixed that bug by wrapping a section of code in a setTimeout? Ever found that fix to be unreliable, and played around with the timeout number until it kinda almost always worked? \nThis talk looks at the browser's event loop, the thing that orchestrates the main thread of the browser, which includes JavaScript, events, and rendering. We'll look at the difference between tasks, microtasks, requestAnimationFrame, requestIdleCallback, and where events land. \nHopefully you'll never have to use setTimeout hacks again!\"
descriptionHtml: <p>Have you ever had a bug where things were happening in the wrong order, or particular style changes were being ignored? Ever fixed that bug by wrapping a section of code in a setTimeout? Ever found that fix to be unreliable, and played around with the timeout number until it kinda almost always worked? \nThis talk looks at the browser's event loop, the thing that orchestrates the main thread of the browser, which includes JavaScript, events, and rendering. We'll look at the difference between tasks, microtasks, requestAnimationFrame, requestIdleCallback, and where events land. \nHopefully you'll never have to use setTimeout hacks again!\"</p>
userId: 4c617f2b-2bad-498b-a9c6-4e9a8c303798
public: true
lastAccessedAt: 2020-02-15T21:12:12.670Z
likeCount: 0
youtubeVideoId: cCOL7MC4Pl0
responses:
201:
description: Empty response, http status is relevant
headers:
location:
description: resource url of the newly created bookmark
schema:
type: object
content: {}
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
400:
$ref: '#/components/responses/ValidationError'
409:
description: |
Conflict. It can be triggered either when trying to create a public bookmark that is already present
or a bookmark with the location is already present for the user
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
x-codegen-request-body-name: body
delete:
description: Batch delete personal bookmarks, given query parameters
operationId: delete-personal-bookmarks
tags:
- personal-bookmarks
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: '#/components/parameters/locationQueryParam'
- in: query
name: tag
description: Private bookmarks with this tag will be batch deleted. It is considered in combination with the `type` param which needs to have the value `private`
schema:
type: string
- in: query
name: type
schema:
type: string
enum:
- private
responses:
204:
description: OK (No content) when bookmarks have been deleted
content: {}
400:
$ref: '#/components/responses/ValidationError'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
500:
$ref: '#/components/responses/InternalServerError'
/personal/users/{userId}/bookmarks/suggested-tags:
get:
description: Returns suggested tags used in auto-completion when saving a bookmark
operationId: get-suggested-tags-for-user
tags:
- personal-bookmarks
parameters:
- $ref: '#/components/parameters/userIdPathParam'
responses:
200:
description: OK
content:
application/json:
schema:
properties:
tags:
type: array
items:
type: string
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/bookmarks/{bookmarkId}:
get:
description: Returns bookmark for user
operationId: get-bookmark-for-user-by-id
tags:
- personal-bookmarks
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: '#/components/parameters/bookmarkIdPathParam'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Bookmark'
400:
$ref: '#/components/responses/ValidationError'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
500:
description: internal server error, when unknown server error is catched
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
put:
description: (full) update existing bookmark of user
operationId: update-bookmark
tags:
- personal-bookmarks
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: '#/components/parameters/bookmarkIdPathParam'
requestBody:
description: Complete bookmark to be updated
content:
application/json:
schema:
$ref: '#/components/schemas/Bookmark'
required: true
responses:
200:
description: OK when operation successful and updated bookmark in body
content:
application/json:
schema:
$ref: '#/components/schemas/Bookmark'
400:
$ref: '#/components/responses/ValidationError'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
500:
description: internal server error, when unknown server error is catched
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
x-codegen-request-body-name: body
delete:
description: deletes bookmark of user
operationId: delete-bookmark
tags:
- personal-bookmarks
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: '#/components/parameters/bookmarkIdPathParam'
responses:
204:
description: OK (No content) when operation successful and bookmark was
removed
content: {}
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
500:
$ref: '#/components/responses/InternalServerError'
/personal/users/{userId}:
description: Operations that work on user data
post:
description: Creates user data
operationId: create-user-data
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
requestBody:
description: User data
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
201:
description: OK when operation successful and updated user data
content:
application/json:
schema:
$ref: '#/components/schemas/User'
get:
description: Reads user data
operationId: get-user-data
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/User'
400:
$ref: '#/components/responses/ValidationError'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
500:
$ref: '#/components/responses/InternalServerError'
put:
description: Updates user data
operationId: update-user-data
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
requestBody:
description: User data
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/User'
400:
$ref: '#/components/responses/ValidationError'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
500:
$ref: '#/components/responses/InternalServerError'
delete:
description: delete user data
operationId: delete-user-data
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
responses:
204:
description: OK - No-content
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
500:
$ref: '#/components/responses/InternalServerError'
/personal/users/{userId}/history:
description: |
Returns latest bookmarks accessed, created or updated by the user
`page` and `limit` query parameters are used for pagination - if missing default values are used.
get:
description: Reads user data
operationId: get-user-data-history
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
responses:
200:
description: OK
$ref: '#/components/responses/BookmarkListResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/pinned:
description: |
Returns pinned bookmarks by the user
`page` and `limit` query parameters are used for pagination - if missing default values are used.
get:
description: Reads user data
operationId: get-user-data-pinned
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
responses:
200:
description: OK
$ref: '#/components/responses/BookmarkListResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/favorites:
description: |
Returns bookmarks user added to **Favorites**
`page` and `limit` query parameters are used for pagination - if missing default values are used.
get:
description: Reads user data
deprecated: true
operationId: get-user-data-favorites
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
responses:
200:
description: OK
$ref: '#/components/responses/BookmarkListResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/feed:
description: |
Returns bookmarks to be displayed on user feed (landing page)
`page` and `limit` query parameters are used for pagination - if missing default values are used.
get:
description: Reads user data
operationId: get-user-feed-bookmarks
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
responses:
200:
description: OK
$ref: '#/components/responses/BookmarkListResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/read-later:
description: |
Returns bookmarks the user added to **Read later**
`page` and `limit` query parameters are used for pagination - if missing default values are used.
get:
description: Reads user data
operationId: get-user-data-read-later
tags:
- user-data
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: "#/components/parameters/pageQueryParam"
- $ref: "#/components/parameters/limitQueryParam"
responses:
200:
description: OK
$ref: '#/components/responses/BookmarkListResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/following/users:
get:
description: get the user profiles of then ones the `userId` is following
operationId: get-follewed-users
tags:
- user-following
parameters:
- $ref: '#/components/parameters/userIdPathParam'
responses:
200:
description: OK
$ref: '#/components/responses/UserDataProfilesResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
/personal/users/{userId}/followers:
get:
description: get the user profiles of `userId`'s followers
operationId: get-followers
tags:
- user-following
parameters:
- $ref: '#/components/parameters/userIdPathParam'
responses:
200:
description: OK
$ref: '#/components/responses/UserDataProfilesResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
404:
$ref: '#/components/responses/NotFoundError'
/personal/users/{userId}/following/users/{followedUserId}:
description: Adds `followedUserId` to the `following` list of `userId`, and `userId` to `followers` list of `followedUserId`
patch:
operationId: add-user-to-following
tags:
- user-following
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: '#/components/parameters/followedUserIdPathParam'
responses:
200:
description: OK
$ref: '#/components/responses/UserDataResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
/personal/users/{userId}/unfollowing/users/{followedUserId}:
description: Removes `followedUserId` from the `following` list of `userId`, and `userId` from the `followers` list of `followedUserId`
patch:
operationId: remove-user-from-following
tags:
- user-following
parameters:
- $ref: '#/components/parameters/userIdPathParam'
- $ref: '#/components/parameters/followedUserIdPathParam'
responses:
200:
description: OK
$ref: '#/components/responses/UserDataResponse'
401:
$ref: '#/components/responses/UnauthorizedError'
403:
$ref: '#/components/responses/ForbiddenError'
components:
schemas:
Bookmark:
required:
- language
- location
- name
- tags
- userId
type: object
properties:
_id:
type: string
name:
type: string
location:
type: string
language:
type: string
tags:
type: array
items:
type: string
description:
type: string
descriptionHtml:
type: string
updatedAt:
type: string
format: date-time
createdAt:
type: string
format: date-time
lastAccessedAt:
type: string
format: date-time
publishedOn:
type: string
format: date
public:
type: boolean
userId:
type: string
likeCount:
type: number
sourceCodeURL:
type: string
ownerVisitCount:
type: number
youtubeVideoId:
type: string
stackoverflowQuestionId:
type: string
UserProfile:
properties:
displayName:
type: string
summary:
type: string
websiteLink:
type: string
twitterLink:
type: string
githubLink:
type: string
linkedinLink:
type: string
Search:
required:
- text
- searchDomain
properties:
text:
type: string
lastAccessedAt:
type: string
format: date-time
searchDomain:
type: string
enum:
- public
- personal
count:
type: integer
Following:
properties:
users:
type: array
items:
type: string
tags:
type: array
items:
type: string
User:
required:
- userId
properties:
userId:
type: string
profile:
$ref: '#/components/schemas/UserProfile'
searches:
type: array
items:
$ref: '#/components/schemas/Search'
readLater:
type: array
items:
type: string
likes:
type: array
items:
type: string
watchedTags:
type: array
items:
type: string
favorites:
deprecated: true
type: array
items:
type: string
history:
type: array
items:
type: string
followers:
type: array
items:
type: string
following:
$ref: '#/components/schemas/Following'
UserDataProfile:
required:
- userId
properties:
userId:
type: string
profile:
$ref: '#/components/schemas/UserProfile'
TagCount:
type: object
required:
- name
- count
properties:
name:
type: string
count:
type: integer
description: how much many times the tag has been used in the specific context
BasicErrorModel:
type: object
required:
- httpStatus
- message
properties:
httpStatus:
type: integer
message:
type: string
type:
type: string
description: specify error Type (e.g. 'MongoError')
stack:
type: string
description: the stacktrace of the error - it is filled only in "development" mode
ValidationErrorModel:
allOf:
- $ref: '#/components/schemas/BasicErrorModel'
- type: object
required:
- validationErrors
- httpStatus
properties:
httpStatus:
type: integer
enum: [400]
validationErrors:
type: array
items:
type: string
WebpageInfo:
type: object
properties:
title:
type: string
metaDescription:
type: string
tags:
description: these are avaialble for youtube videos and stackoverflow questions
type: array
items:
type: string
publishedOn:
type: string
format: date
Version:
type: object
required:
- version
- gitSha1
properties:
version:
type: string
gitSha1:
type: string
parameters:
userIdPathParam:
name: userId
in: path
description: keycloak user id
required: true
schema:
type: string
default: 4c617f2b-2bad-498b-a9c6-4e9a8c303798
followedUserIdPathParam:
name: followedUserId
in: path
description: the id of the user to be following
required: true
schema:
type: string
bookmarkIdPathParam:
name: bookmarkId
in: path
description: id of the bookmark
required: true
schema:
type: string
searchTextQueryParam:
name: q
in: query
description: |
search query (terms are separated by space). There are special filters available:
* `lang:iso_language_code` - e.g. `lang:en` for English, `lang:es` for Spanish and `lang:de` for German bookmarks
* `site:site_URL` - e.g. `site:codepedia.org` bookmarks only from website [www.codepedia.org](https://www.codepedia.org)
* `userId:UUID-user` - to be used only when querying **public bookmarks** submitted by the user with `userId`
* `private:only` - makes sense **only** when used for querying **personal bookmarks**
schema:
type: string
examples: # Multiple examples
german:
value: 'lang:de' # Example value
summary: Will look only for bookmarks in German
site:
value: 'site:codepedia.org'
summary: Wille look only for bookmarks with the domain **codepedia.org**
complex:
value: 'exception handling [java] site:codepedia.org'
summary: Wille look only for bookmarks with terms "exception" and "handling" tagged with "java" and the domain **codepedia.org**
complex-private-only:
value: 'exception handling [java] site:wiki.my-corporation.com private:only'
summary: Same as above but only within **private** bookmarks
pageQueryParam:
name: page
in: query
description: |
Pagination query param - it is used to skip results in combination with `limit` query param
Defaults to **1** and in this case **no results are skipped**
required: false
schema:
type: integer
default: 1
format: int32
limitQueryParam:
name: limit
in: query
description: Limits the number of returned results (used in combination with queryParam)
required: false
schema:
type: integer
default: 55
format: int32
locationQueryParam:
name: location
in: query
description: location of the bookmark, usually an URL
required: false
schema:
type: string
securitySchemes:
bearerAuth: # arbitrary name for the security scheme
type: http
scheme: bearer
bearerFormat: JWT
responses:
BookmarkListResponse:
description: List of bookmarks
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Bookmark'
UserDataResponse:
description: User data
content:
application/json:
schema:
$ref: '#/components/schemas/User'
UserDataProfilesResponse:
description: List of user profiles
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UserDataProfile'
ForbiddenError:
description: Access token is missing or invalid
UnauthorizedError: