@@ -27,6 +27,14 @@ paths:
2727 summary : " Get Agencies"
2828 operationId : " getAgencies"
2929 description : " Get a list of all agencies"
30+ parameters :
31+ - $ref : ' ../common/pagination.yaml#/components/parameters/page'
32+ - $ref : ' ../common/pagination.yaml#/components/parameters/per_page'
33+ - $ref : ' #/components/parameters/jurisdiction'
34+ - $ref : ' #/components/parameters/name'
35+ - $ref : ' #/components/parameters/zip_code'
36+ - $ref : ' #/components/parameters/city'
37+ - $ref : ' #/components/parameters/state'
3038 tags :
3139 - Agencies
3240 responses :
@@ -101,17 +109,29 @@ paths:
101109 $ref : ' #/components/schemas/Agency'
102110 ' 400 ' :
103111 $ref : ' ../common/error.yaml#/components/responses/validationError'
112+ ' 404 ' :
113+ $ref : ' ../common/error.yaml#/components/responses/notFoundError'
104114 /agencies/{agency_uid}/officers :
105- parameters :
106- - name : " agency_uid"
107- in : " path"
108- description : " The uid of the agency you want to retrieve."
109- required : true
110- schema :
111- type : " string"
112115 get :
113116 summary : " Get Officers"
114117 operationId : " getOfficers"
118+ parameters :
119+ - name : " agency_uid"
120+ in : " path"
121+ description : " The uid of the agency you want to retrieve."
122+ required : true
123+ schema :
124+ type : " string"
125+ - $ref : ' ../common/pagination.yaml#/components/parameters/page'
126+ - $ref : ' ../common/pagination.yaml#/components/parameters/per_page'
127+ - $ref : ' officers.yaml#/components/parameters/active_after'
128+ - $ref : ' officers.yaml#/components/parameters/active_before'
129+ - $ref : ' officers.yaml#/components/parameters/agency'
130+ - $ref : ' officers.yaml#/components/parameters/rank'
131+ - $ref : ' officers.yaml#/components/parameters/unit'
132+ - $ref : ' officers.yaml#/components/parameters/name'
133+ - $ref : ' officers.yaml#/components/parameters/ethnicity'
134+ - $ref : ' officers.yaml#/components/parameters/badge_number'
115135 description : >
116136 Get a list of all of the officers who have been employed
117137 by a given agency.
@@ -124,13 +144,24 @@ paths:
124144 application/json :
125145 schema :
126146 $ref : officers.yaml#/components/schemas/OfficerList
147+ ' 400 ' :
148+ $ref : ' ../common/error.yaml#/components/responses/validationError'
149+ ' 404 ' :
150+ $ref : ' ../common/error.yaml#/components/responses/notFoundError'
127151 put :
128152 summary : " Add Employment Records"
129153 operationId : " addOfficers"
130154 description : >
131155 Adds officer employment records to an agency. Can only
132156 add records for officers that already exist in the database.
133157 User must be a contributor.
158+ parameters :
159+ - name : " agency_uid"
160+ in : " path"
161+ description : " The uid of the agency you want to retrieve."
162+ required : true
163+ schema :
164+ type : " string"
134165 tags :
135166 - Units
136167 requestBody :
@@ -153,17 +184,23 @@ paths:
153184 ' 404 ' :
154185 $ref : ' ../common/error.yaml#/components/responses/notFoundError'
155186 /agencies/{agency_uid}/units :
156- parameters :
157- - name : " agency_uid"
158- in : " path"
159- description : " The uid of the agency you want to retrieve."
160- required : true
161- schema :
162- type : " string"
163187 get :
164188 summary : " Get Units"
165189 operationId : " getUnits"
166190 description : " Get a list of all units for a given agency."
191+ parameters :
192+ - name : " agency_uid"
193+ in : " path"
194+ description : " The uid of the agency you want to retrieve units for."
195+ required : true
196+ schema :
197+ type : " string"
198+ - $ref : ' ../common/pagination.yaml#/components/parameters/page'
199+ - $ref : ' ../common/pagination.yaml#/components/parameters/per_page'
200+ - $ref : ' #/components/parameters/name'
201+ - $ref : ' #/components/parameters/zip_code'
202+ - $ref : ' #/components/parameters/city'
203+ - $ref : ' #/components/parameters/state'
167204 tags :
168205 - Units
169206 responses :
@@ -179,6 +216,13 @@ paths:
179216 summary : " Create Unit"
180217 operationId : " createUnit"
181218 description : " Adds a unit or command to an existing agency. User must be a contributor."
219+ parameters :
220+ - name : " agency_uid"
221+ in : " path"
222+ description : " The uid of the agency you want to retrieve units for."
223+ required : true
224+ schema :
225+ type : " string"
182226 tags :
183227 - Units
184228 requestBody :
@@ -197,20 +241,9 @@ paths:
197241 $ref : " #/components/schemas/CreateUnit"
198242 ' 400 ' :
199243 $ref : ' ../common/error.yaml#/components/responses/validationError'
244+ ' 404 ' :
245+ $ref : ' ../common/error.yaml#/components/responses/notFoundError'
200246 /agencies/{agency_uid}/units/{unit_uid} :
201- parameters :
202- - name : " agency_uid"
203- in : " path"
204- description : " The uid of the agency you want to retrieve."
205- required : true
206- schema :
207- type : " string"
208- - name : " unit_uid"
209- in : " path"
210- description : " The uid of the agency you want to retrieve."
211- required : true
212- schema :
213- type : " string"
214247 get :
215248 summary : " Get Unit"
216249 operationId : " getUnit"
@@ -225,17 +258,40 @@ paths:
225258 required : true
226259 schema :
227260 type : " string"
261+ - name : " unit_uid"
262+ in : " path"
263+ description : " The uid of the unit you want to retrieve."
264+ required : true
265+ schema :
266+ type : " string"
228267 responses :
229268 " 200 " :
230269 description : " A JSON array of unit objects"
231270 content :
232271 application/json :
233272 schema :
234273 $ref : " #/components/schemas/Unit"
274+ ' 400 ' :
275+ $ref : ' ../common/error.yaml#/components/responses/validationError'
276+ ' 404 ' :
277+ $ref : ' ../common/error.yaml#/components/responses/notFoundError'
235278 patch :
236279 summary : " Update Unit"
237280 operationId : " updateUnit"
238281 description : " Update an existing unit. User must be a contributor."
282+ parameters :
283+ - name : " agency_uid"
284+ in : " path"
285+ description : " The uid of the agency you want to retrieve units for."
286+ required : true
287+ schema :
288+ type : " string"
289+ - name : " unit_uid"
290+ in : " path"
291+ description : " The uid of the unit you want to retrieve."
292+ required : true
293+ schema :
294+ type : " string"
239295 tags :
240296 - Units
241297 requestBody :
@@ -254,12 +310,50 @@ paths:
254310 $ref : " #/components/schemas/Unit"
255311 ' 400 ' :
256312 $ref : ' ../common/error.yaml#/components/responses/validationError'
313+ ' 404 ' :
314+ $ref : ' ../common/error.yaml#/components/responses/notFoundError'
257315components :
258316 securitySchemes :
259317 bearerAuth :
260318 type : http
261319 scheme : bearer
262320 bearerFormat : JWT
321+ parameters :
322+ jurisdiction :
323+ name : " jurisdiction"
324+ in : " query"
325+ description : " Filter agencies by jurisdiction"
326+ required : false
327+ schema :
328+ type : " string"
329+ zip_code :
330+ name : " zip_code"
331+ in : " query"
332+ description : " Filter by zip code"
333+ required : false
334+ schema :
335+ type : " string"
336+ city :
337+ name : " city"
338+ in : " query"
339+ description : " Filter by city"
340+ required : false
341+ schema :
342+ type : " string"
343+ state :
344+ name : " state"
345+ in : " query"
346+ description : " Filter by state"
347+ required : false
348+ schema :
349+ type : " string"
350+ name :
351+ name : " name"
352+ in : " query"
353+ description : " Filter by name"
354+ required : false
355+ schema :
356+ type : " string"
263357 schemas :
264358 BaseAgency :
265359 type : " object"
0 commit comments