Skip to content

Commit

Permalink
📝 started documenting api endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
MattMoony committed May 7, 2024
1 parent fc59804 commit 37342e6
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
openapi: 3.1.0
info:
title: glass-pane
description: An attempt at a glass pane through which to view the internals of power. 🪟
termsOfService: https://github.com/MattMoony/glass-pane/blob/master/LICENSE
version: 0.0.1
license:
name: GNU General Public License v3.0
identifier: GPL-3.0-or-later
contact:
name: MattMoony
url: https://github.com/MattMoony
externalDocs:
description: General documentation
url: https://github.com/MattMoony/glass-pane/
servers:
- url: http://localhost:8888
description: Currently not public (locally hosted).
tags:
- name: organs
description: All operations relating to base organs.
- name: people
description: All operatoins relating to people.
- name: organizations
description: All operations relating to organizations.
paths:
/organ/{organId}:
get:
tags:
- organs
summary: Get an organ by its ID.
description: Get an organ by its ID.
operationId: organ-get
parameters:
- in: path
name: organId
schema:
type: integer
required: true
description: Numeric ID of the organ to get.
responses:
"200":
description: The target organ, if found.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Response"
- type: object
properties:
organ:
$ref: "#/components/schemas/Organ"
examples:
ValidResponse:
description: Valid Response.
value:
success: true
organ:
id: 8
bio: This is some info bla bla.
InvalidResponse:
$ref: "#/components/examples/InvalidResponse"
components:
schemas:
Response:
type: object
required:
- success
properties:
success:
type: boolean
msg:
type: string
Organ:
type: object
required:
- id
properties:
id:
type: integer
bio:
type: string
examples:
ValidResponse:
description: Valid response.
value:
success: true
InvalidResponse:
description: Invalid response.
value:
success: false
msg: Missing parameters.
SampleOrgan:
description: A sample organ.
value:
id: 8
bio: Some description bla bla.

0 comments on commit 37342e6

Please sign in to comment.