/
public_api.yml
148 lines (141 loc) · 3.94 KB
/
public_api.yml
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
openapi: "3.0.3"
info:
title: Case Law Public API
version: "0.1.3"
description: National Archives Caselaw Public API
servers:
- url: https://{environment}.nationalarchives.gov.uk/
variables:
environment:
default: caselaw
enum:
- caselaw # Production
- staging.caselaw # Staging
tags:
- name: Reading
description: Operations for reading document content and metadata
components:
parameters:
judgmentUri:
name: judgmentUri
in: path
required: true
schema:
type: string
example: ewhc/tcc/2022/42
responses:
judgmentFeed:
description: An Atom feed of recently published judgments
content:
"application/atom+xml":
schema:
description: List in Atom
# judgmentList:
# description: An OData collection of judgment entities
# content:
# "application/xml":
# schema:
# description: An OData collection of judgment entities
judgment:
description: A single judgment document, in Akoma Ntoso XML
content:
"application/akn+xml":
schema:
description: Akoma Ntoso
paths:
/{court}/{subdivision}/{year}/atom.xml:
get:
summary: Get recently published or updated judgments
description: >
Less specific feeds can be gained by omitting the components
e.g. /, /2022/, /ewhc/ and /ewhc/ch/ are all valid prefixes to atom.xml
Note that a {court} is required if there is a {subdivision}
operationId: listJudgments
tags:
- Reading
parameters:
- name: court
required: true
in: path
example: ewca
schema:
type: string
- name: subdivision
required: true
in: path
example: pat
schema:
type: string
- name: year
required: true
in: path
example: 2022
schema:
type: integer
- name: order
required: false
in: query
schema:
type: string
enum:
- date
- -date
- updated
- -updated
- transformation
- -transformation
default: -date
- name: page
required: false
in: query
schema:
type: integer
default: 1
responses:
"200":
$ref: "#/components/responses/judgmentFeed"
# /judgments/advanced_search:
# get:
# summary: List published judgments
# operationId: searchJudgments
# tags:
# - Reading
# parameters:
# - name: query
# in: query
# description: Free-text search term. Can include neutral citations
# example: "[2021] EWCA Crim 1785"
# - name: party
# in: query
# description: search in party name fields
# example: John Doe
# - name: judge
# in: query
# description: search for judge name
# example: Lord Justice Smith
# - name: court
# in: query
# description: search for judgments made by a specific court
# example: ewhc/pat
# - name: from
# in: query
# description: find judgments on or after the specified date
# example: 1987-12-01
# - name: to
# in: query
# description: find judgments on or before the specified date
# example: 2022-04-14
# responses:
# '200':
# $ref: "#/components/responses/judgmentList"
/{judgmentUri}/data.xml:
get:
summary: Read a published judgment or decision, given its URI
operationId: getDocumentByUri
tags:
- Reading
parameters:
- $ref: "#/components/parameters/judgmentUri"
responses:
"200":
$ref: "#/components/responses/judgment"