-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create dedicated API endpoint for on-this-day
- Loading branch information
1 parent
77db545
commit 07c0a1a
Showing
4 changed files
with
143 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# /documents/otd path | ||
get: | ||
tags: | ||
- Documents | ||
summary: Returns documents which feature events on this day | ||
description: | | ||
This endpoint returns a list of documents which feature events on this day. | ||
The events are extracted from the metadata (e.g. birth of a person, writing date of a letter) | ||
and do not take mentioned events (from the text) into account. | ||
parameters: | ||
- name: date | ||
in: query | ||
description: | | ||
The day and month to search for in years before the given year. | ||
If no date is provided, the current server date will be used. | ||
required: false | ||
schema: | ||
type: string | ||
format: date | ||
default: '2024-12-18' | ||
- $ref: '../parameters/docType.yaml' | ||
- $ref: '../parameters/offset.yaml' | ||
- $ref: '../parameters/limit.yaml' | ||
responses: | ||
'200': | ||
description: An array of documents | ||
headers: | ||
totalrecordcount: | ||
description: The total size of the result set | ||
schema: | ||
type: integer | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../schemas/document.yaml' | ||
default: | ||
$ref: '../responses/unexpectedError.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Document "on this day" schema | ||
# This is merely a clone of the document schema | ||
# with additional properties for "on this day" | ||
type: object | ||
properties: | ||
uri: | ||
type: string | ||
description: Unique identifier representing a specific document | ||
docID: | ||
type: string | ||
description: The WeGA document identifier representing a specific document | ||
docType: | ||
type: string | ||
description: The WeGA document type | ||
title: | ||
type: string | ||
description: The title of the document | ||
otdTitle: | ||
type: string | ||
description: The title of the event | ||
otdEvent: | ||
type: string | ||
description: The type of event occurring in the document | ||
enum: | ||
- birth | ||
- death | ||
otdJubilee: | ||
type: integer | ||
format: int32 | ||
description: The years between the event and the provided on-this-day date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters