An incomplete, but possibly sufficient OpenAPI specification for reading pages from Wiki. The main anticipated consumer of this spec is generators of static pages from wiki as a database. swagger
See example: Wiki as flat json database
This spec mostly restates information from JSON Schema and Federating Foreign Servers, but possibly useful for translating it into OpenAPI conventions.
I specify `host` as `earth.wiki.dbbs.co`. That value would be different for every wiki in the federation.
There are some glaring _omissions_ in the spec below and at least one known _mistake_. Omitted are any operations to _create_, _edit_, or _delete_ wiki pages. Those are omitted because all would require authentication and options for authenticating with wiki are numerous, and primarily focused on human authors, not API clients. The known mistake is related. The `item` in an `Action` object, _can_ be an `Item` (like those found in a `Story`), but can also be other things depending on the `type` of the `Action`. Not sure yet if its worth the effort to discover and document those details.
openapi: 3.0.0 servers: - url: '{scheme}://{wiki-domain}' variables: wiki-domain: default: earth.wiki.dbbs.co scheme: default: https info: version: 1.0.0 title: Wiki API tags: - name: page description: a wiki page externalDocs: description: See url: 'http://ward.fed.wiki.org/json-schema.html' paths: '/{slug}.json': get: tags: - page summary: Find page by slug description: Returns a single page operationId: getPageBySlug parameters: - name: slug in: path description: Slug of page to return required: true schema: type: string format: int64 responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/Page' '400': description: Invalid ID supplied '404': description: Page not found /assets/{path}: get: tags: - assets summary: Download an asset operationId: getAsset parameters: - name: path in: path required: true schema: type: string format: path responses: '200': description: successful operation content: application/octet-stream: schema: type: string format: binary '404': description: File not found /system/sitemap.json: get: tags: - system operationId: getSitemap responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/Sitemap' /system/export.json: get: tags: - system operationId: getExport responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/Export' externalDocs: description: How to Wiki url: 'http://help.wiki.org' components: schemas: Page: type: object properties: title: type: string story: $ref: '#/components/schemas/Story' journal: $ref: '#/components/schemas/Journal' Story: type: array items: $ref: '#/components/schemas/Item' Item: type: object properties: id: type: string pattern: '[0-9a-f]+' type: type: string text: type: string date: type: integer format: int64 Journal: type: array items: $ref: '#/components/schemas/Action' Action: type: object properties: type: type: string enum: - create - add - move - edit - remove - fork id: type: string pattern: '[0-9a-f]+' date: type: integer format: int64 item: $ref: '#/components/schemas/Item' site: type: string Sitemap: type: array items: type: object properties: slug: $ref: '#/components/schemas/Slug' title: type: string date: type: integer format: int64 synopsis: type: string Export: description: Keys are Slugs. Values are Pages type: object properties: welcome-visitors: $ref: '#/components/schemas/Page' additionalProperties: $ref: '#/components/schemas/Page' Slug: type: string pattern: '[a-z0-9-]'
earth