Skip to content

Commit 994b8c2

Browse files
committed
Added documentation for search
1 parent 99d7d97 commit 994b8c2

File tree

1 file changed

+134
-1
lines changed

1 file changed

+134
-1
lines changed

backend/schemas/swagger.yaml

Lines changed: 134 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tags:
2020
- name: Messages
2121
description: Send and receive messages
2222
- name: Recommendations
23+
- name: Search
2324
- name: User
2425
description: Get user info
2526
- name: Debug
@@ -1204,6 +1205,36 @@ paths:
12041205
message:
12051206
type: string
12061207
example: Image successfully deleted.
1208+
/search:
1209+
post:
1210+
summary: Search users
1211+
operationId: searchUsers
1212+
security:
1213+
- bearerAuth: [ ]
1214+
tags:
1215+
- Search
1216+
responses:
1217+
"400":
1218+
$ref: '#/components/responses/BadRequest'
1219+
"200":
1220+
description: Returns a list of users based on the search
1221+
content:
1222+
application/json:
1223+
schema:
1224+
type: object
1225+
properties:
1226+
success:
1227+
type: boolean
1228+
description: If the request is a success
1229+
example: true
1230+
code:
1231+
type: integer
1232+
description: The status code
1233+
example: 200
1234+
search_results:
1235+
type: array
1236+
items:
1237+
$ref: '#/components/schemas/SearchResult'
12071238

12081239

12091240
servers:
@@ -1894,4 +1925,106 @@ components:
18941925
is_primary:
18951926
type: boolean
18961927
description: Is this image the profile picture of the user
1897-
example: true
1928+
example: true
1929+
SearchResult:
1930+
type: object
1931+
properties:
1932+
common_tags:
1933+
type: array
1934+
example: [ "friends", "drinks", "sun" ]
1935+
distance:
1936+
type: integer
1937+
example: 50
1938+
description: The distance between two users
1939+
id:
1940+
type: integer
1941+
example: 1
1942+
first_name:
1943+
type: string
1944+
example: Foo
1945+
last_name:
1946+
type: string
1947+
example: Bar
1948+
username:
1949+
type: string
1950+
example: FooBar
1951+
email:
1952+
type: string
1953+
example: foo@example.org
1954+
bio:
1955+
type: string
1956+
example: Lorem Ipsum is the single greatest threat. We are not - we are not keeping up with other websites. Lorem Ipsum best not make any more threats to your website. It will be met with fire and fury like the world has never seen. Does everybody know that pig named Lorem Ipsum? An ‘extremely credible source’ has called my office and told me that Barack Obama’s placeholder text is a fraud.
1957+
birthdate:
1958+
type: date
1959+
example: Mon, 06 Apr 1998 00:00:00 GMT
1960+
gender:
1961+
type: string
1962+
enum: [ "male", "female", "other" ]
1963+
example: male
1964+
orientation:
1965+
type: string
1966+
enum: [ "heterosexual", "homosexual", "bisexual", "other" ]
1967+
example: heterosexual
1968+
geohash:
1969+
type: string
1970+
example: u09whv25xgzn
1971+
heat_score:
1972+
type: integer
1973+
example: 123
1974+
confirmed_on:
1975+
type: date
1976+
example: Wed, 16 Sep 2020 15:20:02 GMT
1977+
date_joined:
1978+
type: date
1979+
example: Wed, 16 Sep 2020 15:18:02 GMT
1980+
date_lastseen:
1981+
type: date
1982+
example: Wed, 19 Sep 2020 19:24:02 GMT
1983+
is_confirmed:
1984+
type: boolean
1985+
example: true
1986+
is_online:
1987+
type: boolean
1988+
example: true
1989+
is_profile_completed:
1990+
type: boolean
1991+
example: true
1992+
age:
1993+
type: int
1994+
example: 22
1995+
likes:
1996+
type: object
1997+
properties:
1998+
sent:
1999+
type: array
2000+
items:
2001+
$ref: '#/components/schemas/Like'
2002+
uniqueItems: true
2003+
received:
2004+
type: array
2005+
items:
2006+
$ref: '#/components/schemas/Like'
2007+
uniqueItems: true
2008+
reports:
2009+
type: object
2010+
properties:
2011+
sent:
2012+
type: array
2013+
items:
2014+
$ref: '#/components/schemas/Report'
2015+
uniqueItems: true
2016+
received:
2017+
type: array
2018+
items:
2019+
$ref: '#/components/schemas/Report'
2020+
uniqueItems: true
2021+
tags:
2022+
type: array
2023+
items:
2024+
$ref: '#/components/schemas/Tag'
2025+
uniqueItems: true
2026+
images:
2027+
type: array
2028+
items:
2029+
$ref: '#/components/schemas/Image'
2030+
uniqueItems: true

0 commit comments

Comments
 (0)