docs: Add OpenAPI 3.0 specification #14

Merged
Leon Schmidt merged 1 commit from cloudy/cloudflare-workers-url-shortener:docs/openapi-spec into main 2026-04-18 13:20:24 +02:00
Collaborator

Description

Adds a complete OpenAPI 3.0 specification for the URL shortener API.

Covered Endpoints

Authentication:

  • GET /api/auth-ok - Validate token
  • GET /api/login - Login with cookie
  • GET /api/logout - Logout

Shortlinks:

  • GET /api/shortlink - List all shortlinks
  • POST /api/shortlink - Create shortlink
  • DELETE /api/shortlink - Delete shortlink

Public:

  • GET /{shortname} - Redirect (no auth)

Features

  • Full request/response schemas
  • Validation rules documented (name pattern, URL protocols)
  • Error response examples
  • CORS headers noted

Closes #6

## Description Adds a complete OpenAPI 3.0 specification for the URL shortener API. ### Covered Endpoints **Authentication:** - `GET /api/auth-ok` - Validate token - `GET /api/login` - Login with cookie - `GET /api/logout` - Logout **Shortlinks:** - `GET /api/shortlink` - List all shortlinks - `POST /api/shortlink` - Create shortlink - `DELETE /api/shortlink` - Delete shortlink **Public:** - `GET /{shortname}` - Redirect (no auth) ### Features - Full request/response schemas - Validation rules documented (name pattern, URL protocols) - Error response examples - CORS headers noted Closes #6
Covers all API endpoints:
- Authentication (auth-ok, login, logout)
- Shortlinks CRUD (GET, POST, DELETE)
- Public redirect endpoint

Includes detailed validation rules, examples, and error responses.
Owner

LGTM

LGTM
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
leon/cloudflare-workers-url-shortener!14
No description provided.