Node.js based forum software built for the modern web
docs: openapi schema for newly added routes
Julian Lam02f567ff3f39
diff --git a/public/openapi/write.yaml b/public/openapi/write.yamlindex 30ec5c326a..5a4d77c94e 100644--- a/public/openapi/write.yaml+++ b/public/openapi/write.yaml@@ -144,6 +144,10 @@ paths:$ref: 'write/topics/tid/events/eventId.yaml'/posts/{pid}:$ref: 'write/posts/pid.yaml'+ /posts/{pid}/raw:+ $ref: 'write/posts/pid/raw.yaml'+ /posts/{pid}/summary:+ $ref: 'write/posts/pid/summary.yaml'/posts/{pid}/state:$ref: 'write/posts/pid/state.yaml'/posts/{pid}/move:diff --git a/public/openapi/write/posts/pid/raw.yaml b/public/openapi/write/posts/pid/raw.yamlnew file mode 100644index 0000000000..ceaf744e4b--- /dev/null+++ b/public/openapi/write/posts/pid/raw.yaml@@ -0,0 +1,28 @@+get:+ tags:+ - posts+ summary: get post's raw content+ description: This operation retrieves a post's raw content (unparsed by markdown, etc.)+ parameters:+ - in: path+ name: pid+ schema:+ type: string+ required: true+ description: a valid post id+ example: 2+ responses:+ '200':+ description: Post raw content successfully retrieved.+ content:+ application/json:+ schema:+ type: object+ properties:+ status:+ $ref: ../../../components/schemas/Status.yaml#/Status+ response:+ type: object+ properties:+ content:+ type: stringdiff --git a/public/openapi/write/posts/pid/summary.yaml b/public/openapi/write/posts/pid/summary.yamlnew file mode 100644index 0000000000..29d46c4129--- /dev/null+++ b/public/openapi/write/posts/pid/summary.yaml@@ -0,0 +1,70 @@+get:+ tags:+ - posts+ summary: get post summary+ description: |+ This operation retrieves a post full summary.++ This differs from the "get a post" call in that it will return the following additional information:++ * A minimal user object+ * A topic object+ * A category object+ * Post content is run through the parser++ parameters:+ - in: path+ name: pid+ schema:+ type: string+ required: true+ description: a valid post id+ example: 2+ responses:+ '200':+ description: Post summary successfully retrieved.+ content:+ application/json:+ schema:+ type: object+ properties:+ status:+ $ref: ../../../components/schemas/Status.yaml#/Status+ response:+ type: object+ properties:+ pid:+ type: number+ tid:+ type: number+ description: A topic identifier+ content:+ type: string+ uid:+ type: number+ description: A user identifier+ timestamp:+ type: number+ deleted:+ type: number+ upvotes:+ type: number+ downvotes:+ type: number+ replies:+ type: number+ votes:+ type: number+ timestampISO:+ type: string+ user:+ type: object+ additionalProperties: {}+ topic:+ type: object+ additionalProperties: {}+ category:+ type: object+ additionalProperties: {}+ isMainPost:+ type: boolean\ No newline at end of file