Skip to content

Commit 423e3e8

Browse files
committed
Add URL to dataSource
1 parent 792325f commit 423e3e8

7 files changed

Lines changed: 44 additions & 4 deletions

File tree

openapi/components/schemas/DataSource.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ properties:
1818
type: string
1919
description: The retrieval date of the version of the dataset.
2020
example: 2026-04-17
21+
url:
22+
type: string
23+
description: The URL at which users can find the dataset
24+
example: 'https://data.cityofnewyork.us/Business/Legally-Operating-Businesses/w7w3-xahh'
2125
required:
2226
- schemaName
2327
- datasetName
2428
- version
2529
- retrieveDate
30+
- url

src/facility/facility.repository.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ export class FacilityRepository {
362362
'schemaName', ${dataSource.schemaName},
363363
'datasetName', ${dataSource.datasetName},
364364
'version', ${dataSource.version},
365-
'retrieveDate', ${dataSource.retrieveDate}
365+
'retrieveDate', ${dataSource.retrieveDate},
366+
'url', ${dataSource.url}
366367
)
367368
`.as("dataSource"),
368369
alsoAtLocation: sql<any[]>`
@@ -440,6 +441,7 @@ export class FacilityRepository {
440441
dataSource.datasetName,
441442
dataSource.version,
442443
dataSource.retrieveDate,
444+
dataSource.url,
443445
);
444446
} catch {
445447
throw new DataRetrievalException("Cannot find Facility with given id");

src/gen/schemas/dataSource.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@
2121
"type": "string",
2222
"description": "The retrieval date of the version of the dataset.",
2323
"example": "2026-04-17"
24+
},
25+
"url": {
26+
"type": "string",
27+
"description": "The URL at which users can find the dataset",
28+
"example": "https://data.cityofnewyork.us/Business/Legally-Operating-Businesses/w7w3-xahh"
2429
}
2530
},
26-
"required": ["schemaName", "datasetName", "version", "retrieveDate"],
31+
"required": ["schemaName", "datasetName", "version", "retrieveDate", "url"],
2732
"x-readme-ref-name": "DataSource"
2833
}

src/gen/schemas/facility.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,20 @@
118118
"type": "string",
119119
"description": "The retrieval date of the version of the dataset.",
120120
"example": "2026-04-17"
121+
},
122+
"url": {
123+
"type": "string",
124+
"description": "The URL at which users can find the dataset",
125+
"example": "https://data.cityofnewyork.us/Business/Legally-Operating-Businesses/w7w3-xahh"
121126
}
122127
},
123-
"required": ["schemaName", "datasetName", "version", "retrieveDate"],
128+
"required": [
129+
"schemaName",
130+
"datasetName",
131+
"version",
132+
"retrieveDate",
133+
"url"
134+
],
124135
"x-readme-ref-name": "DataSource"
125136
},
126137
"alsoAtLocation": {

src/gen/schemas/facilityGeoJson.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,20 @@
149149
"type": "string",
150150
"description": "The retrieval date of the version of the dataset.",
151151
"example": "2026-04-17"
152+
},
153+
"url": {
154+
"type": "string",
155+
"description": "The URL at which users can find the dataset",
156+
"example": "https://data.cityofnewyork.us/Business/Legally-Operating-Businesses/w7w3-xahh"
152157
}
153158
},
154-
"required": ["schemaName", "datasetName", "version", "retrieveDate"],
159+
"required": [
160+
"schemaName",
161+
"datasetName",
162+
"version",
163+
"retrieveDate",
164+
"url"
165+
],
155166
"x-readme-ref-name": "DataSource"
156167
},
157168
"alsoAtLocation": {

src/gen/types/DataSource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ export type DataSource = {
2424
* @type string
2525
*/
2626
retrieveDate: string;
27+
/**
28+
* @description The URL at which users can find the dataset
29+
* @type string
30+
*/
31+
url: string;
2732
};

src/gen/zod/dataSourceSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export const dataSourceSchema = z.object({
1212
retrieveDate: z
1313
.string()
1414
.describe("The retrieval date of the version of the dataset."),
15+
url: z.string().describe("The URL at which users can find the dataset"),
1516
});

0 commit comments

Comments
 (0)