Skip to content

Instantly share code, notes, and snippets.

@rmarji
Forked from roaldnefs/openapi.yaml
Last active June 10, 2024 21:17
Show Gist options
  • Select an option

  • Save rmarji/55ce48d28d5e9148d2fd4b5b9bf31e97 to your computer and use it in GitHub Desktop.

Select an option

Save rmarji/55ce48d28d5e9148d2fd4b5b9bf31e97 to your computer and use it in GitHub Desktop.
OpenApi specification for xkcd
openapi: 3.1.0
info:
title: Goals Blueprint API
description: API for managing goals, owners, delegates, accountables, ideas, tasks, and user information.
version: 1.0.0
servers:
- url: https://goals.arootah.com
description: Production server
paths:
/api/v1/goals_blueprint/goals/:
post:
operationId: createGoal
summary: Create a Goal
security:
- bearerAuth: []
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
area:
type: string
description: UserArea ID
category:
type: string
description: UserCategory ID
subcategory:
type: string
description: UserSubCategory ID
statement:
type: string
description: Goal statement
label:
type: string
description: Goal label
unit:
type: string
description: Goal unit
frequency:
type: array
items:
type: string
description: Can choose multiple days
gap_current_value:
type: integer
gap_target_value:
type: integer
startline:
type: string
format: date
description: Start date
deadline:
type: string
format: date
description: Deadline
pleasure:
type: string
description: Pleasure from achieving the goal
pain:
type: string
description: Pain from not achieving the goal
obstacles:
type: string
description: Obstacles to achieving the goal
brainstorm:
type: string
description: Brainstorm ideas to overcome obstacles
resources:
type: string
description: Resources needed
rewards:
type: string
description: Rewards for achieving the goal
consequences:
type: string
description: Consequences of not achieving the goal
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/Goal"
/api/v1/goals_blueprint/goals/{id}/:
patch:
operationId: updateGoal
summary: Update a Goal
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
status:
type: string
description: Choices are "Active", "On hold", "Completed", "Future"
area:
type: string
category:
type: string
subcategory:
type: string
statement:
type: string
label:
type: string
unit:
type: string
frequency:
type: array
items:
type: string
gap_current_value:
type: integer
gap_target_value:
type: integer
startline:
type: string
format: date
deadline:
type: string
format: date
pleasure:
type: string
pain:
type: string
obstacles:
type: string
brainstorm:
type: string
resources:
type: string
rewards:
type: string
consequences:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Goal"
delete:
operationId: deleteGoal
summary: Delete a Goal
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
"204":
description: No Content
get:
operationId: retrieveGoals
summary: Retrieve Goals
security:
- bearerAuth: []
parameters:
- name: user
in: query
required: true
schema:
type: integer
- name: status
in: query
schema:
type: string
- name: area
in: query
schema:
type: integer
- name: category
in: query
schema:
type: integer
- name: subcategory
in: query
schema:
type: integer
- name: ordering
in: query
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Goal"
/api/v1/users/my_user/:
get:
operationId: getUserInfo
summary: Get User Information
security:
- bearerAuth: []
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
Goal:
type: object
properties:
id:
type: integer
frequency:
type: array
items:
type: string
owners:
type: array
items:
type: object
properties:
id:
type: integer
email:
type: string
name:
type: string
username:
type: string
is_coach:
type: boolean
user_coach:
type: string
profile_picture:
type: string
delegates:
type: array
items:
type: object
accountables:
type: array
items:
type: object
status:
type: string
statement:
type: string
label:
type: string
unit:
type: string
gap_current_value:
type: integer
gap_target_value:
type: integer
gap_value_difference:
type: integer
gap_percent_difference:
type: integer
startline:
type: string
format: date
deadline:
type: string
format: date
pleasure:
type: string
pain:
type: string
obstacles:
type: string
brainstorm:
type: string
resources:
type: string
rewards:
type: string
consequences:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
user:
type: integer
area:
type: object
properties:
id:
type: integer
name:
type: string
is_custom:
type: boolean
priority:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
user:
type: integer
parent_workspace:
type: integer
category:
type: object
properties:
id:
type: integer
values:
type: array
items:
type: object
properties:
id:
type: integer
name:
type: string
code:
type: string
description:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
category:
type: integer
roles:
type: array
items:
type: object
properties:
id:
type: integer
name:
type: string
code:
type: string
description:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
category:
type: integer
name:
type: string
description:
type: string
is_custom:
type: boolean
principle:
type: string
code_of_conduct:
type: string
vision:
type: string
pleasure:
type: string
pain:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
user:
type: integer
parent_area:
type: integer
subcategory:
type: string
User:
type: object
properties:
id:
type: integer
email:
type: string
name:
type: string
username:
type: string
profile_picture:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment