Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[chore] maintained project collection api specification

Eric Schubert9478214ba2f4
diff --git a/docs/api/apiv3/components/examples/project_collection.yml b/docs/api/apiv3/components/examples/project_collection.yml
new file mode 100644
index 00000000000..f6aba691786
--- /dev/null
+++ b/docs/api/apiv3/components/examples/project_collection.yml
@@ -0,0 +1,40 @@
+# Example: Project collection
+---
+value:
+ _type: Collection
+ count: 2
+ total: 2
+ pageSize: 20
+ offset: 1
+ _embedded:
+ elements:
+ - _hint: Project resource shortened for brevity
+ id: 1
+ identifier: initialproject
+ name: DeathStar construction
+ active: true
+ public: true
+ - _hint: Project resource shortened for brevity
+ id: 2
+ identifier: mysecret
+ name: Palpatine's secret plan
+ active: true
+ public: false
+ _links:
+ self:
+ href: '/api/v3/projects?filters=%5B%5D&offset=1&pageSize=20'
+ jumpTo:
+ href: '/api/v3/projects?filters=%5B%5D&offset=%7Boffset%7D&pageSize=20'
+ templated: true
+ changeSize:
+ href: '/api/v3/projects?filters=%5B%5D&offset=1&pageSize=%7Bsize%7D'
+ templated: true
+ representations:
+ - href: '/projects.csv?filters=%5B%5D&offset=1&pageSize=20'
+ identifier: csv
+ type: text/csv
+ title: CSV
+ - href: '/projects.xls?filters=%5B%5D&offset=1&pageSize=20'
+ identifier: xls
+ type: application/vnd.ms-excel
+ title: XLS
diff --git a/docs/api/apiv3/components/schemas/link.yml b/docs/api/apiv3/components/schemas/link.yml
index 56633620291..576126e23a7 100644
--- a/docs/api/apiv3/components/schemas/link.yml
+++ b/docs/api/apiv3/components/schemas/link.yml
@@ -26,6 +26,9 @@ properties:
identifier:
type: string
description: An optional unique identifier to the link object
+ type:
+ type: string
+ description: The MIME-Type of the returned resource.
example:
href: '/api/v3/work_packages'
diff --git a/docs/api/apiv3/components/schemas/list_projects_model.yml b/docs/api/apiv3/components/schemas/list_projects_model.yml
deleted file mode 100644
index 0827704f201..00000000000
--- a/docs/api/apiv3/components/schemas/list_projects_model.yml
+++ /dev/null
@@ -1,93 +0,0 @@
-# Schema: List_projectsModel
----
-type: object
-example:
- _links:
- self:
- href: "/api/v3/projects"
- representations:
- - href: "/projects.csv?filters=%5B%7B%22nameAndIdentifier%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%22open%22%5D%7D%7D%5D&offset=1&pageSize=50"
- identifier: "csv"
- type: "text/csv"
- title: "CSV"
- - href: "/projects.xls?filters=%5B%7B%22nameAndIdentifier%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%22open%22%5D%7D%7D%5D&offset=1&pageSize=50"
- identifier: "xls"
- type: "application/vnd.ms-excel"
- title: "XLS"
- _type: Collection
- total: 2
- count: 2
- _embedded:
- elements:
- - _type: Project
- _links:
- self:
- href: "/api/v3/projects/6"
- title: A project
- createWorkPackage:
- href: "/api/v3/projects/6/work_packages/form"
- method: post
- createWorkPackageImmediate:
- href: "/api/v3/projects/6/work_packages"
- method: post
- categories:
- href: "/api/v3/projects/6/categories"
- versions:
- href: "/api/v3/projects/6/versions"
- projects:
- href: "/api/v3/projects/123"
- status:
- href: "/api/v3/project_statuses/on_track"
- title: On track
- id: 6
- identifier: a_project
- name: A project
- active: true
- statusExplanation:
- format: markdown
- raw: Everything **fine**
- html: "<p>Everything <strong>fine</strong></p>"
- public: false
- description:
- format: markdown
- raw: Lorem **ipsum** dolor sit amet
- html: "<p>Lorem <strong>ipsum</strong> dolor sit amet</p>"
- createdAt: '2015-07-06T13:28:14+00:00'
- updatedAt: '2015-10-01T09:55:02+00:00'
- type: Customer Project
- - _type: Project
- _links:
- self:
- href: "/api/v3/projects/14"
- title: Another project
- createWorkPackage:
- href: "/api/v3/projects/14/work_packages/form"
- method: post
- createWorkPackageImmediate:
- href: "/api/v3/projects/14/work_packages"
- method: post
- categories:
- href: "/api/v3/projects/14/categories"
- versions:
- href: "/api/v3/projects/14/versions"
- projects:
- href:
- status:
- href: "/api/v3/project_statuses/off_track"
- title: Off track
- id: 14
- identifier: another_project
- name: Another project
- active: false
- statusExplanation:
- format: markdown
- raw: Uh **oh**
- html: "<p>Uh <strong>oh</strong></p>"
- public: true
- description:
- format: markdown
- raw: ''
- html: ''
- createdAt: '2016-02-29T12:50:20+00:00'
- updatedAt: '2016-02-29T12:50:20+00:00'
- type:
diff --git a/docs/api/apiv3/components/schemas/project_collection_model.yml b/docs/api/apiv3/components/schemas/project_collection_model.yml
new file mode 100644
index 00000000000..298bfa54718
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/project_collection_model.yml
@@ -0,0 +1,38 @@
+# Schema: ProjectCollectionModel
+---
+allOf:
+ - $ref: './collection_model.yml'
+ - type: object
+ required:
+ - _links
+ - _embedded
+ properties:
+ _links:
+ type: object
+ required:
+ - self
+ - representations
+ properties:
+ self:
+ allOf:
+ - $ref: "./link.yml"
+ - description: |-
+ This file links collection
+
+ **Resource**: ProjectStorageCollectionModel
+ representations:
+ type: array
+ items:
+ allOf:
+ - $ref: "./link.yml"
+ - description: |-
+ A project collection representation in a specific file format.
+ _embedded:
+ type: object
+ required:
+ - elements
+ properties:
+ elements:
+ type: array
+ items:
+ $ref: './project_model.yml'
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index e535f4fcdb8..27438f18537 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -497,6 +497,8 @@ components:
$ref: './components/examples/project.yml'
ProjectBody:
$ref: './components/examples/project_body.yml'
+ ProjectCollection:
+ $ref: './components/examples/project_collection.yml'
QueriesModel:
$ref: './components/examples/queries.yml'
QueryModel:
@@ -631,8 +633,6 @@ components:
"$ref": "./components/schemas/list_capabilities_model.yml"
List_of_NewsModel:
"$ref": "./components/schemas/list_of_news_model.yml"
- List_projectsModel:
- "$ref": "./components/schemas/list_projects_model.yml"
List_projects_by_versionModel:
"$ref": "./components/schemas/list_projects_by_version_model.yml"
MarkdownModel:
@@ -675,6 +675,8 @@ components:
"$ref": "./components/schemas/priorities_model.yml"
PriorityModel:
"$ref": "./components/schemas/priority_model.yml"
+ ProjectCollectionModel:
+ "$ref": "./components/schemas/project_collection_model.yml"
ProjectModel:
"$ref": "./components/schemas/project_model.yml"
ProjectStorageCollectionModel:
diff --git a/docs/api/apiv3/paths/memberships_available_projects.yml b/docs/api/apiv3/paths/memberships_available_projects.yml
index 9a1da8eb3f0..fc5ca818462 100644
--- a/docs/api/apiv3/paths/memberships_available_projects.yml
+++ b/docs/api/apiv3/paths/memberships_available_projects.yml
@@ -14,7 +14,10 @@ get:
content:
application/hal+json:
schema:
- $ref: '../components/schemas/list_projects_model.yml'
+ $ref: '../components/schemas/project_collection_model.yml'
+ examples:
+ 'simple project collection':
+ $ref: '../components/examples/project_collection.yml'
'403':
content:
application/hal+json:
diff --git a/docs/api/apiv3/paths/projects.yml b/docs/api/apiv3/paths/projects.yml
index a6fbd251eb8..4e5d1c8bcd7 100644
--- a/docs/api/apiv3/paths/projects.yml
+++ b/docs/api/apiv3/paths/projects.yml
@@ -69,7 +69,10 @@ get:
content:
application/hal+json:
schema:
- $ref: '../components/schemas/list_projects_model.yml'
+ $ref: '../components/schemas/project_collection_model.yml'
+ examples:
+ 'simple project collection':
+ $ref: '../components/examples/project_collection.yml'
'400':
description: Returned if the client sends invalid request parameters e.g. filters
content: