chore: generate swagger docs

This commit is contained in:
kolaente 2022-12-29 18:46:36 +01:00
parent fd9b2e15d9
commit 1af82f6686
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 213 additions and 3026 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -358,112 +358,6 @@ definitions:
description: A standard message.
type: string
type: object
models.Namespace:
properties:
created:
description: A timestamp when this namespace was created. You cannot change
this value.
type: string
description:
description: The description of the namespace
type: string
hex_color:
description: The hex color of this namespace
maxLength: 6
type: string
id:
description: The unique, numeric id of this namespace.
type: integer
is_archived:
description: Whether or not a namespace is archived.
type: boolean
owner:
allOf:
- $ref: '#/definitions/user.User'
description: The user who owns this namespace
subscription:
allOf:
- $ref: '#/definitions/models.Subscription'
description: |-
The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.
Will only returned when retreiving one namespace.
title:
description: The name of this namespace.
maxLength: 250
minLength: 1
type: string
updated:
description: A timestamp when this namespace was last updated. You cannot
change this value.
type: string
type: object
models.NamespaceUser:
properties:
created:
description: A timestamp when this relation was created. You cannot change
this value.
type: string
id:
description: The unique, numeric id of this namespace <-> user relation.
type: integer
right:
allOf:
- $ref: '#/definitions/models.Right'
default: 0
description: The right this user has. 0 = Read only, 1 = Read & Write, 2 =
Admin. See the docs for more details.
maximum: 2
updated:
description: A timestamp when this relation was last updated. You cannot change
this value.
type: string
user_id:
description: The username.
type: string
type: object
models.NamespaceWithProjects:
properties:
created:
description: A timestamp when this namespace was created. You cannot change
this value.
type: string
description:
description: The description of the namespace
type: string
hex_color:
description: The hex color of this namespace
maxLength: 6
type: string
id:
description: The unique, numeric id of this namespace.
type: integer
is_archived:
description: Whether or not a namespace is archived.
type: boolean
owner:
allOf:
- $ref: '#/definitions/user.User'
description: The user who owns this namespace
projects:
items:
$ref: '#/definitions/models.Project'
type: array
subscription:
allOf:
- $ref: '#/definitions/models.Subscription'
description: |-
The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.
Will only returned when retreiving one namespace.
title:
description: The name of this namespace.
maxLength: 250
minLength: 1
type: string
updated:
description: A timestamp when this namespace was last updated. You cannot
change this value.
type: string
type: object
models.Project:
properties:
background_blur_hash:
@ -475,6 +369,10 @@ definitions:
description: Holds extra information about the background set since some background
providers require attribution or similar. If not null, the background can
be accessed at /projects/{projectID}/background
child_projects:
items:
$ref: '#/definitions/models.Project'
type: array
created:
description: A timestamp when this project was created. You cannot change
this value.
@ -495,19 +393,19 @@ definitions:
minLength: 0
type: string
is_archived:
description: Whether or not a project is archived.
description: Whether a project is archived.
type: boolean
is_favorite:
description: True if a project is a favorite. Favorite projects show up in
a separate namespace. This value depends on the user making the call to
the api.
a separate parent project. This value depends on the user making the call
to the api.
type: boolean
namespace_id:
type: integer
owner:
allOf:
- $ref: '#/definitions/user.User'
description: The user who created this project.
parent_project_id:
type: integer
position:
description: The position this project has when querying all projects. See
the tasks.position property on how to use this.
@ -519,7 +417,7 @@ definitions:
The subscription status for the user reading this project. You can only read this property, use the subscription endpoints to modify it.
Will only returned when retreiving one project.
title:
description: The title of the project. You'll see this in the namespace overview.
description: The title of the project. You'll see this in the overview.
maxLength: 250
minLength: 1
type: string
@ -530,8 +428,8 @@ definitions:
type: object
models.ProjectDuplicate:
properties:
namespace_id:
description: The target namespace ID
parent_project_id:
description: The target parent project
type: integer
project:
allOf:
@ -624,7 +522,7 @@ definitions:
type: integer
is_favorite:
description: True if the filter is a favorite. Favorite filters show up in
a separate namespace together with favorite projects.
a separate parent project together with favorite projects.
type: boolean
owner:
allOf:
@ -948,30 +846,6 @@ definitions:
user id entering.
type: string
type: object
models.TeamNamespace:
properties:
created:
description: A timestamp when this relation was created. You cannot change
this value.
type: string
id:
description: The unique, numeric id of this namespace <-> team relation.
type: integer
right:
allOf:
- $ref: '#/definitions/models.Right'
default: 0
description: The right this team has. 0 = Read only, 1 = Read & Write, 2 =
Admin. See the docs for more details.
maximum: 2
team_id:
description: The team id.
type: integer
updated:
description: A timestamp when this relation was last updated. You cannot change
this value.
type: string
type: object
models.TeamProject:
properties:
created:
@ -1413,7 +1287,7 @@ info:
* `x-pagination-total-pages`: The total number of available pages for this request
* `x-pagination-result-count`: The number of items returned for this request.
# Rights
All endpoints which return a single item (project, task, namespace, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.
All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.
This can be used to show or hide ui elements based on the rights the user has.
# Authorization
**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer <jwt-token>`-header to authenticate successfully.
@ -2250,624 +2124,6 @@ paths:
summary: Get migration status
tags:
- migration
/namespace/{id}:
post:
consumes:
- application/json
description: Updates a namespace.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
- description: The namespace with updated values you want to update.
in: body
name: namespace
required: true
schema:
$ref: '#/definitions/models.Namespace'
produces:
- application/json
responses:
"200":
description: The updated namespace.
schema:
$ref: '#/definitions/models.Namespace'
"400":
description: Invalid namespace object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Updates a namespace
tags:
- namespace
/namespaces:
get:
consumes:
- application/json
description: Returns all namespaces a user has access to.
parameters:
- description: The page number. Used for pagination. If not provided, the first
page of results is returned.
in: query
name: page
type: integer
- description: The maximum number of items per page. Note this parameter is
limited by the configured maximum of items per page.
in: query
name: per_page
type: integer
- description: Search namespaces by name.
in: query
name: s
type: string
- description: If true, also returns all archived namespaces.
in: query
name: is_archived
type: boolean
- description: If true, also returns only namespaces without their projects.
in: query
name: namespaces_only
type: boolean
produces:
- application/json
responses:
"200":
description: The Namespaces.
schema:
items:
$ref: '#/definitions/models.NamespaceWithProjects'
type: array
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Get all namespaces a user has access to
tags:
- namespace
put:
consumes:
- application/json
description: Creates a new namespace.
parameters:
- description: The namespace you want to create.
in: body
name: namespace
required: true
schema:
$ref: '#/definitions/models.Namespace'
produces:
- application/json
responses:
"201":
description: The created namespace.
schema:
$ref: '#/definitions/models.Namespace'
"400":
description: Invalid namespace object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Creates a new namespace
tags:
- namespace
/namespaces/{id}:
delete:
description: Delets a namespace
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The namespace was successfully deleted.
schema:
$ref: '#/definitions/models.Message'
"400":
description: Invalid namespace object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Deletes a namespace
tags:
- namespace
get:
consumes:
- application/json
description: Returns a namespace by its ID.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The Namespace
schema:
$ref: '#/definitions/models.Namespace'
"403":
description: The user does not have access to that namespace.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Gets one namespace
tags:
- namespace
/namespaces/{id}/projects:
get:
consumes:
- application/json
description: Returns all projects inside of a namespace.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The projects.
schema:
items:
$ref: '#/definitions/models.Project'
type: array
"403":
description: No access to that namespace.
schema:
$ref: '#/definitions/models.Message'
"404":
description: The namespace does not exist.
schema:
$ref: '#/definitions/models.Message'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Get all projects in a namespace
tags:
- namespace
/namespaces/{id}/teams:
get:
consumes:
- application/json
description: Returns a namespace with all teams which have access on a given
namespace.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
- description: The page number. Used for pagination. If not provided, the first
page of results is returned.
in: query
name: page
type: integer
- description: The maximum number of items per page. Note this parameter is
limited by the configured maximum of items per page.
in: query
name: per_page
type: integer
- description: Search teams by its name.
in: query
name: s
type: string
produces:
- application/json
responses:
"200":
description: The teams with the right they have.
schema:
items:
$ref: '#/definitions/models.TeamWithRight'
type: array
"403":
description: No right to see the namespace.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Get teams on a namespace
tags:
- sharing
put:
consumes:
- application/json
description: Gives a team access to a namespace.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
- description: The team you want to add to the namespace.
in: body
name: namespace
required: true
schema:
$ref: '#/definitions/models.TeamNamespace'
produces:
- application/json
responses:
"201":
description: The created team<->namespace relation.
schema:
$ref: '#/definitions/models.TeamNamespace'
"400":
description: Invalid team namespace object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The team does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"404":
description: The team does not exist.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Add a team to a namespace
tags:
- sharing
/namespaces/{id}/users:
get:
consumes:
- application/json
description: Returns a namespace with all users which have access on a given
namespace.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
- description: The page number. Used for pagination. If not provided, the first
page of results is returned.
in: query
name: page
type: integer
- description: The maximum number of items per page. Note this parameter is
limited by the configured maximum of items per page.
in: query
name: per_page
type: integer
- description: Search users by its name.
in: query
name: s
type: string
produces:
- application/json
responses:
"200":
description: The users with the right they have.
schema:
items:
$ref: '#/definitions/models.UserWithRight'
type: array
"403":
description: No right to see the namespace.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Get users on a namespace
tags:
- sharing
put:
consumes:
- application/json
description: Gives a user access to a namespace.
parameters:
- description: Namespace ID
in: path
name: id
required: true
type: integer
- description: The user you want to add to the namespace.
in: body
name: namespace
required: true
schema:
$ref: '#/definitions/models.NamespaceUser'
produces:
- application/json
responses:
"201":
description: The created user<->namespace relation.
schema:
$ref: '#/definitions/models.NamespaceUser'
"400":
description: Invalid user namespace object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"404":
description: The user does not exist.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Add a user to a namespace
tags:
- sharing
/namespaces/{namespaceID}/projects:
put:
consumes:
- application/json
description: Creates a new project in a given namespace. The user needs write-access
to the namespace.
parameters:
- description: Namespace ID
in: path
name: namespaceID
required: true
type: integer
- description: The project you want to create.
in: body
name: project
required: true
schema:
$ref: '#/definitions/models.Project'
produces:
- application/json
responses:
"201":
description: The created project.
schema:
$ref: '#/definitions/models.Project'
"400":
description: Invalid project object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the project
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Creates a new project
tags:
- project
/namespaces/{namespaceID}/teams/{teamID}:
delete:
description: Delets a team from a namespace. The team won't have access to the
namespace anymore.
parameters:
- description: Namespace ID
in: path
name: namespaceID
required: true
type: integer
- description: team ID
in: path
name: teamID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The team was successfully deleted.
schema:
$ref: '#/definitions/models.Message'
"403":
description: The team does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"404":
description: team or namespace does not exist.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Delete a team from a namespace
tags:
- sharing
post:
consumes:
- application/json
description: Update a team <-> namespace relation. Mostly used to update the
right that team has.
parameters:
- description: Namespace ID
in: path
name: namespaceID
required: true
type: integer
- description: Team ID
in: path
name: teamID
required: true
type: integer
- description: The team you want to update.
in: body
name: namespace
required: true
schema:
$ref: '#/definitions/models.TeamNamespace'
produces:
- application/json
responses:
"200":
description: The updated team <-> namespace relation.
schema:
$ref: '#/definitions/models.TeamNamespace'
"403":
description: The team does not have admin-access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"404":
description: Team or namespace does not exist.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Update a team <-> namespace relation
tags:
- sharing
/namespaces/{namespaceID}/users/{userID}:
delete:
description: Delets a user from a namespace. The user won't have access to the
namespace anymore.
parameters:
- description: Namespace ID
in: path
name: namespaceID
required: true
type: integer
- description: user ID
in: path
name: userID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: The user was successfully deleted.
schema:
$ref: '#/definitions/models.Message'
"403":
description: The user does not have access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"404":
description: user or namespace does not exist.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Delete a user from a namespace
tags:
- sharing
post:
consumes:
- application/json
description: Update a user <-> namespace relation. Mostly used to update the
right that user has.
parameters:
- description: Namespace ID
in: path
name: namespaceID
required: true
type: integer
- description: User ID
in: path
name: userID
required: true
type: integer
- description: The user you want to update.
in: body
name: namespace
required: true
schema:
$ref: '#/definitions/models.NamespaceUser'
produces:
- application/json
responses:
"200":
description: The updated user <-> namespace relation.
schema:
$ref: '#/definitions/models.NamespaceUser'
"403":
description: The user does not have admin-access to the namespace
schema:
$ref: '#/definitions/web.HTTPError'
"404":
description: User or namespace does not exist.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Update a user <-> namespace relation
tags:
- sharing
/notifications:
get:
consumes:
@ -2988,6 +2244,42 @@ paths:
summary: Get all projects a user has access to
tags:
- project
put:
consumes:
- application/json
description: Creates a new project. If a parent project is provided the user
needs to have write access to that project.
parameters:
- description: The project you want to create.
in: body
name: project
required: true
schema:
$ref: '#/definitions/models.Project'
produces:
- application/json
responses:
"201":
description: The created project.
schema:
$ref: '#/definitions/models.Project'
"400":
description: Invalid project object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the project
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Creates a new project
tags:
- project
/projects/{id}:
delete:
description: Delets a project
@ -3876,15 +3168,15 @@ paths:
- application/json
description: Copies the project, tasks, files, kanban data, assignees, comments,
attachments, lables, relations, backgrounds, user/team rights and link shares
from one project to a new namespace. The user needs read access in the project
and write access in the namespace of the new project.
from one project to a new one. The user needs read access in the project and
write access in the parent of the new project.
parameters:
- description: The project ID to duplicate
in: path
name: projectID
required: true
type: integer
- description: The target namespace which should hold the copied project.
- description: The target parent project which should hold the copied project.
in: body
name: project
required: true
@ -3902,7 +3194,7 @@ paths:
schema:
$ref: '#/definitions/web.HTTPError'
"403":
description: The user does not have access to the project or namespace
description: The user does not have access to the project or its parent.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
@ -4244,8 +3536,8 @@ paths:
- application/json
description: Unsubscribes the current user to an entity.
parameters:
- description: The entity the user subscribed to. Can be either `namespace`,
`project` or `task`.
- description: The entity the user subscribed to. Can be either `project` or
`task`.
in: path
name: entity
required: true
@ -4284,8 +3576,8 @@ paths:
- application/json
description: Subscribes the current user to an entity.
parameters:
- description: The entity the user subscribes to. Can be either `namespace`,
`project` or `task`.
- description: The entity the user subscribes to. Can be either `project` or
`task`.
in: path
name: entity
required: true
@ -5353,8 +4645,7 @@ paths:
put:
consumes:
- application/json
description: Creates a new team in a given namespace. The user needs write-access
to the namespace.
description: Creates a new team.
parameters:
- description: The team you want to create.
in: body