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

identify a week day by its href

Christophe Bliard625984b16f32
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 39b93b1a1f6..4e725ebbe24 100644
--- a/docs/api/apiv3/components/schemas/non_working_day_model.yml
+++ b/docs/api/apiv3/components/schemas/non_working_day_model.yml
@@ -32,9 +32,9 @@ properties:
**Resource**: NonWorkingDay or WeekDay
example:
_type: NonWorkingDay
- date: '2022-05-07'
- name: Saturday
+ date: '2022-12-25'
+ name: Christmas
_links:
self:
- href: /api/v3/work_schedule/non_working_days/2022-05-07
- title: Saturday
+ href: /api/v3/work_schedule/non_working_days/2022-12-25
+ title: Christmas
diff --git a/docs/api/apiv3/components/schemas/week_day_collection_write_model.yml b/docs/api/apiv3/components/schemas/week_day_collection_write_model.yml
index a65c2e81fd9..d5e9e87079b 100644
--- a/docs/api/apiv3/components/schemas/week_day_collection_write_model.yml
+++ b/docs/api/apiv3/components/schemas/week_day_collection_write_model.yml
@@ -18,33 +18,45 @@ properties:
type: array
description: |-
The array of week days.
- minItems: 7
+ minItems: 1
maxItems: 7
items:
- $ref: './week_day_write_model.yml'
+ allOf:
+ - $ref: './week_day_write_model.yml'
+ - type: object
+ required:
+ - _links
+ properties:
+ _links:
+ allOf:
+ - $ref: './week_day_self_link_model.yml'
example:
_type: Collection
_embedded:
elements:
- _type: WeekDay
- day: 1
working: true
+ _links:
+ self:
+ href: '/api/v3/days/week/1'
- _type: WeekDay
- day: 2
working: true
+ _links:
+ self:
+ href: '/api/v3/days/week/2'
- _type: WeekDay
- day: 3
working: true
+ _links:
+ self:
+ href: '/api/v3/days/week/4'
- _type: WeekDay
- day: 4
- working: true
- - _type: WeekDay
- day: 5
- working: true
- - _type: WeekDay
- day: 6
working: false
+ _links:
+ self:
+ href: '/api/v3/days/week/6'
- _type: WeekDay
- day: 7
working: false
+ _links:
+ self:
+ href: '/api/v3/days/week/7'
diff --git a/docs/api/apiv3/components/schemas/week_day_model.yml b/docs/api/apiv3/components/schemas/week_day_model.yml
index 973112d4784..47c0441d547 100644
--- a/docs/api/apiv3/components/schemas/week_day_model.yml
+++ b/docs/api/apiv3/components/schemas/week_day_model.yml
@@ -27,16 +27,8 @@ properties:
description: |-
`true` for a working day. `false` for a weekend day.
_links:
- type: object
- properties:
- self:
- allOf:
- - "$ref": "./link.yml"
- - description: |-
- This week day resource link.
-
- **Resource**: WeekDay
- readOnly: true
+ allOf:
+ - $ref: './week_day_self_link_model.yml'
example:
_type: WeekDay
day: 5
diff --git a/docs/api/apiv3/components/schemas/week_day_self_link_model.yml b/docs/api/apiv3/components/schemas/week_day_self_link_model.yml
new file mode 100644
index 00000000000..de3b10bce97
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/week_day_self_link_model.yml
@@ -0,0 +1,18 @@
+# WeekDaySelfLinkModel
+---
+type: object
+description: |-
+ Identify a particular week day by its href.
+properties:
+ self:
+ allOf:
+ - "$ref": "./link.yml"
+ - description: |-
+ This week day resource link.
+
+ **Resource**: WeekDay
+ readOnly: true
+example:
+ self:
+ href: /api/v3/days/week/3
+ title: Wednesday
diff --git a/docs/api/apiv3/components/schemas/week_day_write_model.yml b/docs/api/apiv3/components/schemas/week_day_write_model.yml
index d53b23c3707..f87c79c5a9b 100644
--- a/docs/api/apiv3/components/schemas/week_day_write_model.yml
+++ b/docs/api/apiv3/components/schemas/week_day_write_model.yml
@@ -5,25 +5,16 @@ description: |-
Describes a week day as a working day or a non working day (weekend).
required:
- _type
- - day
- working
properties:
_type:
type: string
enum:
- WeekDay
- day:
- type: integer
- description: |-
- The week day from 1 to 7. 1 is Monday. 7 is Sunday.
- readOnly: true
- minimum: 1
- maximum: 7
working:
type: boolean
description: |-
`true` for a working day. `false` for a weekend day.
example:
_type: WeekDay
- day: 5
working: false
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index 1114f2e487e..754962392b6 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -778,6 +778,8 @@ components:
"$ref": "./components/schemas/week_day_collection_write_model.yml"
WeekDayModel:
"$ref": "./components/schemas/week_day_model.yml"
+ WeekDaySelfLinkModel:
+ "$ref": "./components/schemas/week_day_self_link_model.yml"
WeekDayWriteModel:
"$ref": "./components/schemas/week_day_write_model.yml"
Wiki_PageModel: