Files
api/api.yaml

85 lines
2.2 KiB
YAML

openapi: 3.0.3
info:
title: TheAdversary api
description: TheAdversary api
version: 1.0.0
servers:
- url: 'https://localhost:8080'
paths:
/api/recent:
get:
summary: Get recent articles
parameters:
- in: query
name: limit
schema:
type: integer
description: Limit of recent articles to return
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
articles:
type: array
items:
$ref: '#/components/schemas/ArticleSummary'
/api/search:
get:
summary: Search all articles
parameters:
- in: query
name: q
schema:
type: string
description: Name of the article to search
- in: query
name: from
schema:
type: string
description: A RFC3339 formatted date to start searching when articles are older than specified
- in: query
name: to
schema:
type: string
description: A RFC3339 formatted date to stop searching when articles are older than specified
- in: query
name: limit
schema:
type: integer
description: Limit of articles to return
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
articles:
type: array
items:
$ref: '#/components/schemas/ArticleSummary'
components:
schemas:
ArticleSummary:
type: object
properties:
title:
type: string
description: Title of the article
summary:
type: string
description: A short overview summary of the article
image:
type: string
description: Link to a preview image
nullable: true
link:
type: string
description: Link to the article itself