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

fix GET /api/v3/days/work_schedule and hrefs

Christophe Bliardd9aeaf3bed8b
diff --git a/docs/api/apiv3/components/schemas/non_working_day_collection_model.yml b/docs/api/apiv3/components/schemas/non_working_day_collection_model.yml
index 0f585f9856a..4a18ea3df32 100644
--- a/docs/api/apiv3/components/schemas/non_working_day_collection_model.yml
+++ b/docs/api/apiv3/components/schemas/non_working_day_collection_model.yml
@@ -39,7 +39,7 @@ example:
count: 6
_links:
self:
- href: '/api/v3/work_schedule/non_working_days?include_weekend=true&filters=[{"interval":{"operator":"<>d","values":["2022-05-01","2022-05-15"]}}]'
+ href: '/api/v3/days/work_schedule?filters=[{"interval":{"operator":"<>d","values":["2022-05-01","2022-05-15"]}}]'
_embedded:
elements:
- _type: NonWorkingDay
@@ -47,40 +47,40 @@ example:
name: Labour day
_links:
self:
- href: /api/v3/work_schedule/non_working_days/2022-05-01
+ href: /api/v3/days/non_working/2022-05-01
title: Labour day
- _type: NonWorkingDay
date: '2022-05-01'
name: Sunday
_links:
self:
- href: /api/v3/work_schedule/week_days/7
+ href: /api/v3/days/week/7
title: Sunday
- _type: NonWorkingDay
date: '2022-05-07'
name: Saturday
_links:
self:
- href: /api/v3/work_schedule/week_days/6
+ href: /api/v3/days/week/6
title: Saturday
- _type: NonWorkingDay
date: '2022-05-08'
name: Sunday
_links:
self:
- href: /api/v3/work_schedule/week_days/7
+ href: /api/v3/days/week/7
title: Sunday
- _type: NonWorkingDay
date: '2022-05-14'
name: Saturday
_links:
self:
- href: /api/v3/work_schedule/week_days/6
+ href: /api/v3/days/week/6
title: Saturday
- _type: NonWorkingDay
date: '2022-05-15'
name: Sunday
_links:
self:
- href: /api/v3/work_schedule/week_days/7
+ href: /api/v3/days/week/7
title: Sunday
diff --git a/docs/api/apiv3/components/schemas/non_working_day_model.yml b/docs/api/apiv3/components/schemas/non_working_day_model.yml
index 4e725ebbe24..3433d5b0f84 100644
--- a/docs/api/apiv3/components/schemas/non_working_day_model.yml
+++ b/docs/api/apiv3/components/schemas/non_working_day_model.yml
@@ -36,5 +36,5 @@ example:
name: Christmas
_links:
self:
- href: /api/v3/work_schedule/non_working_days/2022-12-25
+ href: /api/v3/days/non_working/2022-12-25
title: Christmas
diff --git a/docs/api/apiv3/components/schemas/week_day_collection_model.yml b/docs/api/apiv3/components/schemas/week_day_collection_model.yml
index da09ffcb73a..d9d80107443 100644
--- a/docs/api/apiv3/components/schemas/week_day_collection_model.yml
+++ b/docs/api/apiv3/components/schemas/week_day_collection_model.yml
@@ -39,7 +39,7 @@ example:
count: 7
_links:
self:
- href: /api/v3/work_schedule/week_days
+ href: /api/v3/days/week
_embedded:
elements:
- _type: WeekDay
@@ -48,7 +48,7 @@ example:
working: true
_links:
self:
- href: /api/v3/work_schedule/week_days/1
+ href: /api/v3/days/week/1
title: Monday
- _type: WeekDay
day: 2
@@ -56,7 +56,7 @@ example:
working: true
_links:
self:
- href: /api/v3/work_schedule/week_days/2
+ href: /api/v3/days/week/2
title: Tuesday
- _type: WeekDay
day: 3
@@ -64,7 +64,7 @@ example:
working: true
_links:
self:
- href: /api/v3/work_schedule/week_days/3
+ href: /api/v3/days/week/3
title: Wednesday
- _type: WeekDay
day: 4
@@ -72,7 +72,7 @@ example:
working: true
_links:
self:
- href: /api/v3/work_schedule/week_days/4
+ href: /api/v3/days/week/4
title: Thursday
- _type: WeekDay
day: 5
@@ -80,7 +80,7 @@ example:
working: true
_links:
self:
- href: /api/v3/work_schedule/week_days/5
+ href: /api/v3/days/week/5
title: Friday
- _type: WeekDay
day: 6
@@ -88,7 +88,7 @@ example:
working: false
_links:
self:
- href: /api/v3/work_schedule/week_days/6
+ href: /api/v3/days/week/6
title: Saturday
- _type: WeekDay
day: 7
@@ -96,5 +96,5 @@ example:
working: false
_links:
self:
- href: /api/v3/work_schedule/week_days/7
+ href: /api/v3/days/week/7
title: Sunday
diff --git a/docs/api/apiv3/components/schemas/week_day_model.yml b/docs/api/apiv3/components/schemas/week_day_model.yml
index 47c0441d547..d689db6a11c 100644
--- a/docs/api/apiv3/components/schemas/week_day_model.yml
+++ b/docs/api/apiv3/components/schemas/week_day_model.yml
@@ -36,5 +36,5 @@ example:
working: false
_links:
self:
- href: "/api/v3/work_schedule/week_day/5"
+ href: "/api/v3/day/week/5"
title: Friday
diff --git a/docs/api/apiv3/paths/days_work_schedule.yml b/docs/api/apiv3/paths/days_work_schedule.yml
index 7455b72f462..32a53e40ccc 100644
--- a/docs/api/apiv3/paths/days_work_schedule.yml
+++ b/docs/api/apiv3/paths/days_work_schedule.yml
@@ -8,15 +8,10 @@ get:
- Non working days
description: |-
Lists non-working days for a given date interval.
+
+ It will return both weekend days and registered non-working days from the
+ beginning of current month to the end of following month by default.
parameters:
- - name: include_weekend
- in: query
- description: |-
- Include weekend days in the response when `true`.
- required: false
- schema:
- default: false
- type: boolean
- name: filters
in: query
description: |-
@@ -25,11 +20,20 @@ get:
Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/)
endpoint. Currently supported filters are:
- + interval: The inclusive date interval to scope non working days to look up.
+ + interval: the inclusive date interval to scope non-working days to
+ look up. When unspecified, default is from the beginning of current
+ month to the end of following month.
+
+ Example: `{ "interval": { "operator": "<>d", "values": ["2022-05-02","2022-05-26"] } }`
+ would return non-working days between May 5 and May 26 2022, inclusive.
+
+ + type: the type of non-working days to return. Can have the values
+ `NonWorkDay` and `WeekDay`. When unspecified, default is
+ `["NonWorkingDay", "WeekDay"]`
- Example: `{ "interval": { "operator": "<>d", "values": ["2022-05-02","2022-05-26"] } }` would return non working days
- between May 5 and May 26 2022, inclusive.
- example: '[{ "interval": { "operator": "<>d", "values": ["2022-05-02","2022-05-26"] } }]'
+ Example: `{ "type": { "operator": "=", "values": ["NonWorkingDay"] } }`
+ would return registered non working days only.
+ example: '[{ "interval": { "operator": "<>d", "values": ["2022-05-02","2022-05-26"] } }, { "type": { "operator": "=", "values": ["NonWorkingDay"] } }]'
required: false
schema:
type: string