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 000000000000..f6aba6917868 --- /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 566336202914..576126e23a71 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 0827704f201c..000000000000 --- 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: "
Everything fine
" - public: false - description: - format: markdown - raw: Lorem **ipsum** dolor sit amet - html: "Lorem ipsum dolor sit amet
" - 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: "Uh oh
" - 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 000000000000..298bfa547189 --- /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 e535f4fcdb89..27438f185374 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 9a1da8eb3f0b..fc5ca8184627 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 a6fbd251eb84..4e5d1c8bcd7f 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: