Skip to content

Commit

Permalink
Update Spec
Browse files Browse the repository at this point in the history
  • Loading branch information
DMalone87 committed Jun 23, 2024
1 parent cf9f022 commit 3d0483c
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 21 deletions.
9 changes: 7 additions & 2 deletions oas/2.0/agencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-readme:
proxy-enabled: true
samples-enabled: true
security:
- cookieAuth: []
- bearerAuth: []
tags:
- name: "Agencies"
description: "API for managing agencies"
Expand All @@ -41,7 +41,7 @@ paths:
post:
summary: "Create Agency"
operationId: "createAgency"
description: "Create a single agency. User must be a contributor."
description: "Create a new law enforement agency. The user must be a contributor."
tags:
- Agencies
requestBody:
Expand Down Expand Up @@ -255,6 +255,11 @@ paths:
'400':
$ref: '../common/error.yaml#/components/responses/validationError'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
BaseAgency:
type: "object"
Expand Down
140 changes: 123 additions & 17 deletions oas/2.0/litigation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-readme:
proxy-enabled: true
samples-enabled: true
security:
- cookieAuth: []
- bearerAuth: []
tags:
- name: "Litigation"
description: "Litigation API"
Expand All @@ -29,21 +29,37 @@ paths:
summary: "Get all Litigation"
operationId: "getLitigation"
description: >
Get a list of all litigation cases. This endpoint supports
Get a list of all litigation cases. You can use query parameters to filter the results by
including by forum, the officers involved, or the date range.
This endpoint supports
pagination to limit the number of results returned.
parameters:
- name: "page"
- $ref: '../common/pagination.yaml#/components/parameters/page'
- $ref: '../common/pagination.yaml#/components/parameters/per_page'
- name: "court_level"
in: "query"
description: "Page number"
required: false
description: "Filter by court level"
schema:
type: "integer"
- name: "limit"
type: "string"
- name: "jurisdiction"
in: "query"
description: "Number of items per page"
required: false
description: "Filter by jurisdiction"
schema:
type: "integer"
type: "string"
- name: "state"
in: "query"
description: "Filter by state"
schema:
type: "string"
- name: defendants
in: "query"
description: >
Filter by defendants. Include a comma seperated list
of the IDs of the officers whos cases you want returned.
schema:
type: array
items:
type: string
responses:
"200":
description: "Successful response"
Expand Down Expand Up @@ -223,8 +239,65 @@ paths:
$ref: '#/components/schemas/Document'
'404':
$ref: '../common/error.yaml#/components/responses/notFoundError'
/litigation/{id}/disposition:
parameters:
- name: id
in: path
description: ID of the litigation
required: true
schema:
type: string
post:
tags:
- "Litigation"
summary: "Add Disposition"
operationId: "createDisposition"
description: >
Add a new disposition to a litigation.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Disposition"
responses:
200:
description: 'Successful response'
content:
application/json:
schema:
$ref: '#/components/schemas/Litigation'
400:
$ref: '../common/error.yaml#/components/responses/validationError'
404:
$ref: '../common/error.yaml#/components/responses/notFoundError'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
Disposition:
type: "object"
properties:
disposition:
type: "string"
description: >
The disposition of the litigation.
desceripton:
type: "string"
description: >
A description of the disposition. This could include
the terms of a settlement, the amount of a judgment,
or other relevant information.
date:
type: "string"
format: "date"
description: >
The date when this disposition was reached.
required:
- disposition
- date
BaseLitigation:
type: "object"
properties:
Expand Down Expand Up @@ -267,11 +340,13 @@ components:
format: "date"
description: >
The date when this litigation was filed or initiated.
end_date:
type: "string"
format: "date"
dispositions:
type: "array"
description: >
The date when this litigation was resolved or closed.
A list of any dispositions in this litigation. This
could include a settlement, judgment, or other outcome.
items:
$ref: "#/components/schemas/Disposition"
settlement_amount:
type: "number"
description: >
Expand All @@ -290,26 +365,57 @@ components:
allOf:
- $ref: "#/components/schemas/BaseLitigation"
- type: object
- properties:
defendants:
type: "array"
items:
type: "string"
description: >
A list containing the IDs of any officers who are named
as defendants in the litigation.
- required:
- case_title
- docket_number
- defendants
- court_level
- jurisdiction
- state
UpdateLitigation:
allOf:
- $ref: "#/components/schemas/BaseLitigation"
- type: object
properties:
defendants:
type: array
items:
type: string
description: >
A list containing the IDs of any officers who are named
as defendants in the litigation.
Litigation:
allOf:
- $ref: "#/components/schemas/BaseLitigation"
- type: object
- required:
- case_title
- docket_number
required:
- case_title
- docket_number
- defendants
- court_level
- jurisdiction
- state
properties:
id:
type: "string"
description: "The id of the litigation"
documents:
type: "string"
description: "A link to retrieve the documents associated with this litigation"
defendants:
type: "array"
description: >
A list of any officers who are named as defendants in the litigation.
items:
$ref: officers.yaml#/components/schemas/Officer
LitigationList:
allOf:
- $ref: ../common/pagination.yaml#/components/schemas/PaginatedResponse
Expand Down
7 changes: 6 additions & 1 deletion oas/2.0/officers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-readme:
proxy-enabled: true
samples-enabled: true
security:
- cookieAuth: []
- bearerAuth: []
tags:
- name: "Officers"
description: "Officer related endpoints"
Expand Down Expand Up @@ -165,6 +165,11 @@ paths:
'400':
$ref: '../common/error.yaml#/components/responses/validationError'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
BaseEmployment:
type: "object"
Expand Down
7 changes: 6 additions & 1 deletion oas/2.0/partners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-readme:
proxy-enabled: true
samples-enabled: true
security:
- cookieAuth: []
- bearerAuth: []
tags:
- name: "Partners"
description: "Partners API"
Expand Down Expand Up @@ -127,6 +127,11 @@ paths:
$ref: '../common/error.yaml#/components/responses/notFoundError'

components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
BasePartner:
type: "object"
Expand Down
6 changes: 6 additions & 0 deletions oas/common/auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT

0 comments on commit 3d0483c

Please sign in to comment.