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

use more flexible and semantic routes scheme

Christophe Bliard6b3cf754b6ba
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index e540305566a..1114f2e487e 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -175,6 +175,16 @@ paths:
"$ref": "./paths/custom_action_execute.yml"
"/api/v3/custom_options/{id}":
"$ref": "./paths/custom_option.yml"
+ "/api/v3/days/non_working":
+ "$ref": "./paths/days_non_working.yml"
+ "/api/v3/days/non_working/{date}":
+ "$ref": "./paths/days_non_working_date.yml"
+ "/api/v3/days/week":
+ "$ref": "./paths/days_week.yml"
+ "/api/v3/days/week/{day}":
+ "$ref": "./paths/days_week_day.yml"
+ "/api/v3/days/work_schedule":
+ "$ref": "./paths/days_work_schedule.yml"
"/api/v3/documents":
"$ref": "./paths/documents.yml"
"/api/v3/documents/{id}":
@@ -423,15 +433,6 @@ paths:
"$ref": "./paths/work_package_watchers.yml"
"/api/v3/work_packages/{id}/watchers/{user_id}":
"$ref": "./paths/work_package_watcher.yml"
- "/api/v3/work_schedule/week_days":
- "$ref": "./paths/work_schedule_week_days.yml"
- "/api/v3/work_schedule/week_days/{day}":
- "$ref": "./paths/work_schedule_week_day.yml"
- "/api/v3/work_schedule/non_working_days":
- "$ref": "./paths/work_schedule_non_working_days.yml"
- "/api/v3/work_schedule/non_working_days/{date}":
- "$ref": "./paths/work_schedule_non_working_day.yml"
- # TODO: add some **Permission** in some description fields
components:
examples:
diff --git a/docs/api/apiv3/paths/days_non_working.yml b/docs/api/apiv3/paths/days_non_working.yml
new file mode 100644
index 00000000000..219f62c2a51
--- /dev/null
+++ b/docs/api/apiv3/paths/days_non_working.yml
@@ -0,0 +1,57 @@
+# /api/v3/days/non_working
+---
+post:
+ summary: Create a non working day
+ operationId: create_non_working_day
+ tags:
+ - Work Schedule
+ - Non working days
+ description: |-
+ Marks a day as being a non-working day.
+
+ Does nothing if the day is already a non-working day.
+ parameters:
+ - name: date
+ in: query
+ description: |-
+ The date to mark as non-working.
+ required: true
+ schema:
+ type: string
+ format: date
+ example: '2022-12-25'
+ - name: name
+ in: query
+ description: |-
+ A descriptive name for the non-working day.
+ required: false
+ schema:
+ type: string
+ example: 'Christmas'
+ responses:
+ '200':
+ description: OK
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/non_working_day_model.yml'
+ '400':
+ description: Returned if the client sends invalid request parameters.
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/error_response.yml'
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody
+ message: The request body was not a single JSON object.
+ '403':
+ description: Returned if the client does not have sufficient permissions.
+ content:
+ application/hal+json:
+ schema:
+ $ref: '../components/schemas/error_response.yml'
+ example:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery
+ message: You are not authorized to access this resource.
diff --git a/docs/api/apiv3/paths/work_schedule_non_working_day.yml b/docs/api/apiv3/paths/days_non_working_date.yml
similarity index 99%
rename from docs/api/apiv3/paths/work_schedule_non_working_day.yml
rename to docs/api/apiv3/paths/days_non_working_date.yml
index 11fb13e5354..3c3cf5012e3 100644
--- a/docs/api/apiv3/paths/work_schedule_non_working_day.yml
+++ b/docs/api/apiv3/paths/days_non_working_date.yml
@@ -1,4 +1,4 @@
-# /api/v3/non_working_days/{date}
+# /api/v3/days/non_working/{date}
---
get:
summary: View a non-working day
diff --git a/docs/api/apiv3/paths/work_schedule_week_days.yml b/docs/api/apiv3/paths/days_week.yml
similarity index 99%
rename from docs/api/apiv3/paths/work_schedule_week_days.yml
rename to docs/api/apiv3/paths/days_week.yml
index b56658096df..0d7eefdbd43 100644
--- a/docs/api/apiv3/paths/work_schedule_week_days.yml
+++ b/docs/api/apiv3/paths/days_week.yml
@@ -1,3 +1,4 @@
+# /api/v3/days/week
---
get:
summary: Lists week days
diff --git a/docs/api/apiv3/paths/work_schedule_week_day.yml b/docs/api/apiv3/paths/days_week_day.yml
similarity index 99%
rename from docs/api/apiv3/paths/work_schedule_week_day.yml
rename to docs/api/apiv3/paths/days_week_day.yml
index a16cabb2066..afdc5498405 100644
--- a/docs/api/apiv3/paths/work_schedule_week_day.yml
+++ b/docs/api/apiv3/paths/days_week_day.yml
@@ -1,3 +1,4 @@
+# /api/v3/days/week/{day}
---
get:
summary: View a week day
diff --git a/docs/api/apiv3/paths/work_schedule_non_working_days.yml b/docs/api/apiv3/paths/days_work_schedule.yml
similarity index 50%
rename from docs/api/apiv3/paths/work_schedule_non_working_days.yml
rename to docs/api/apiv3/paths/days_work_schedule.yml
index d66820b8a60..7455b72f462 100644
--- a/docs/api/apiv3/paths/work_schedule_non_working_days.yml
+++ b/docs/api/apiv3/paths/days_work_schedule.yml
@@ -1,3 +1,4 @@
+# /api/v3/days/work_schedule
---
get:
summary: Lists non-working days
@@ -49,58 +50,3 @@ get:
_type: Error
errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody
message: The request body was not a single JSON object.
-post:
- summary: Create a non working day
- operationId: create_non_working_day
- tags:
- - Work Schedule
- - Non working days
- description: |-
- Marks a day as being a non-working day.
-
- Does nothing if the day is already a non-working day.
- parameters:
- - name: date
- in: query
- description: |-
- The date to mark as non-working.
- required: true
- schema:
- type: string
- format: date
- example: '2022-12-25'
- - name: name
- in: query
- description: |-
- A descriptive name for the non-working day.
- required: false
- schema:
- type: string
- example: 'Christmas'
- responses:
- '200':
- description: OK
- content:
- application/hal+json:
- schema:
- $ref: '../components/schemas/non_working_day_model.yml'
- '400':
- description: Returned if the client sends invalid request parameters.
- content:
- application/hal+json:
- schema:
- $ref: '../components/schemas/error_response.yml'
- example:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody
- message: The request body was not a single JSON object.
- '403':
- description: Returned if the client does not have sufficient permissions.
- content:
- application/hal+json:
- schema:
- $ref: '../components/schemas/error_response.yml'
- example:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery
- message: You are not authorized to access this resource.