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

Update work package api documentation with dates/duration

Christophe Bliard82091fd727d2
diff --git a/docs/api/apiv3/paths/work_package_form.yml b/docs/api/apiv3/paths/work_package_form.yml
index d7a3cb5afe8..5b7ee305bd3 100644
--- a/docs/api/apiv3/paths/work_package_form.yml
+++ b/docs/api/apiv3/paths/work_package_form.yml
@@ -1,6 +1,21 @@
# /api/v3/work_packages/{id}/form
---
post:
+ summary: Work Package Edit Form
+ operationId: Work_Package_Edit_Form
+ tags:
+ - Work Packages
+ description: |-
+ When calling this endpoint, the client provides a single object containing the properties and links to be edited, in the body.
+
+ Note that it is only allowed to provide properties or links supporting the write operation.
+
+ When setting start date, finish date, and duration together, their correctness will be checked and a 422 error will be returned if one value does not match with the two others. You can make the server compute a value: set only two values in the request and the third one will be computed and returned in the response. For instance, when sending `{ "startDate": "2022-08-23", duration: "P2D" }`, the response will include `{ "dueDate": "2022-08-24" }`.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ "$ref": "../components/schemas/work_package_model.yml"
parameters:
- description: ID of the work package being modified
example: '1'
@@ -51,13 +66,3 @@ post:
$ref: "../components/responses/missing_content_type.yml"
'415':
$ref: "../components/responses/unsupported_media_type.yml"
- tags:
- - Work Packages
- description: ''
- operationId: Work_Package_Edit_Form
- requestBody:
- content:
- application/json:
- schema:
- "$ref": "../components/schemas/work_package_model.yml"
- summary: Work Package Edit Form
diff --git a/docs/api/apiv3/paths/work_packages.yml b/docs/api/apiv3/paths/work_packages.yml
index c49a8e862f5..a318f155c93 100644
--- a/docs/api/apiv3/paths/work_packages.yml
+++ b/docs/api/apiv3/paths/work_packages.yml
@@ -159,6 +159,8 @@ post:
Note that it is only allowed to provide properties or links supporting the write operation.
A project link must be set when creating work packages through this route.
+
+ When setting start date, finish date, and duration together, their correctness will be checked and a 422 error will be returned if one value does not match with the two others. You can make the server compute a value: set only two values in the request and the third one will be computed and returned in the response. For instance, when sending `{ "startDate": "2022-08-23", duration: "P2D" }`, the response will include `{ "dueDate": "2022-08-24" }`.
requestBody:
content:
application/json: