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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[chore] split read and write models
Eric Schubert9b46ac563ea9
diff --git a/docs/api/apiv3/components/schemas/file_links_model.yml b/docs/api/apiv3/components/schemas/file_link_collection_read_model.ymlsimilarity index 91%rename from docs/api/apiv3/components/schemas/file_links_model.ymlrename to docs/api/apiv3/components/schemas/file_link_collection_read_model.ymlindex 401e79aefd2..e9b0cb55a30 100644--- a/docs/api/apiv3/components/schemas/file_links_model.yml+++ b/docs/api/apiv3/components/schemas/file_link_collection_read_model.yml@@ -1,7 +1,7 @@-# Schema: File_LinksModel+# Schema: FileLinkCollectionReadModel---allOf:- - "$ref": './collection_model.yml'+ - $ref: './collection_model.yml'- type: objectrequired:- _links@@ -14,12 +14,11 @@ allOf:properties:self:allOf:- - "$ref": "./link.yml"+ - $ref: "./link.yml"- description: |-This file links list**Resource**: File_LinksModel- readOnly: true_embedded:type: objectrequired:@@ -28,7 +27,7 @@ allOf:elements:type: arrayitems:- $ref: './file_link_model.yml'+ $ref: './file_link_read_model.yml'example:_type: Collection@@ -47,6 +46,7 @@ example:id: 5503name: logo.pngmimeType: image/png+ size: 16042createdAt: '2021-12-19T09:42:10.170Z'lastModifiedAt: '2021-12-20T14:00:13.987Z'createdByName: Luke Skywalkerdiff --git a/docs/api/apiv3/components/schemas/file_link_collection_write_model.yml b/docs/api/apiv3/components/schemas/file_link_collection_write_model.ymlnew file mode 100644index 00000000000..a0a47eb27a2--- /dev/null+++ b/docs/api/apiv3/components/schemas/file_link_collection_write_model.yml@@ -0,0 +1,35 @@+# Schema: FileLinkCollectionWriteModel+---+allOf:+ - $ref: './collection_model.yml'+ - type: object+ required:+ - _embedded+ properties:+ _embedded:+ type: object+ required:+ - elements+ properties:+ elements:+ type: array+ items:+ $ref: './file_link_write_model.yml'++example:+ _embedded:+ elements:+ - originData:+ id: 5503+ name: logo.png+ mimeType: image/png+ size: 16042+ createdAt: '2021-12-19T09:42:10.170Z'+ lastModifiedAt: '2021-12-20T14:00:13.987Z'+ createdByName: Luke Skywalker+ lastModifiedByName: Anakin Skywalker+ _links:+ storage:+ href: /api/v3/storage/42+ - _hint: File Link resource shortened for brevity+ id: 1338diff --git a/docs/api/apiv3/components/schemas/file_link_origin_data_model.yml b/docs/api/apiv3/components/schemas/file_link_origin_data_model.ymlindex 6354f17faf3..68007054e04 100644--- a/docs/api/apiv3/components/schemas/file_link_origin_data_model.yml+++ b/docs/api/apiv3/components/schemas/file_link_origin_data_model.yml@@ -1,10 +1,11 @@-# Schema: File_Link_Origin_DataModel+# Schema: FileLinkOriginDataModel---type: objectrequired:- id- name- mimeType+ - size- createdAt- lastModifiedAt- createdByName@@ -20,12 +21,16 @@ properties:type: stringminLength: 0description: MIME type of the linked file+ size:+ type: integer+ minimum: 0+ description: file size on origin in bytescreatedAt:type: stringformat: date-timedescription: Timestamp of the creation datetime of the file on the originlastModifiedAt:- type: string+ type: stringaformat: date-timedescription: Timestamp of the datetime of the last modification of the file on the origincreatedByName:diff --git a/docs/api/apiv3/components/schemas/file_link_model.yml b/docs/api/apiv3/components/schemas/file_link_read_model.ymlsimilarity index 89%rename from docs/api/apiv3/components/schemas/file_link_model.ymlrename to docs/api/apiv3/components/schemas/file_link_read_model.ymlindex 50003f2afb9..26e804aa502 100644--- a/docs/api/apiv3/components/schemas/file_link_model.yml+++ b/docs/api/apiv3/components/schemas/file_link_read_model.yml@@ -1,4 +1,4 @@-# Schema: File_LinkModel+# Schema: FileLinkReadModel---type: objectrequired:@@ -10,27 +10,22 @@ properties:id:type: integerdescription: File link id- readOnly: true_type:type: stringenum:- FileLink- readOnly: truecreatedAt:type: stringformat: date-timedescription: Time of creation- readOnly: trueupdatedAt:type: stringformat: date-timedescription: Time of the most recent change to the file link- readOnly: trueoriginData:$ref: './file_link_origin_data_model.yml'_embedded:type: object- readOnly: truerequired:- storage- container@@ -56,7 +51,6 @@ properties:This file link.**Resource**: FileLink- readOnly: truestorage:allOf:- $ref: './link.yml'@@ -64,14 +58,6 @@ properties:The storage resource of the linked file.**Resource**: Storage- storageUrl:- allOf:- - $ref: './link.yml'- - description: |-- The storage url the file link references to.-- **Resource**: N/A- writeOnly: truecontainer:allOf:- $ref: './link.yml'@@ -81,7 +67,6 @@ properties:Can be one of the following **Resources**:- WorkPackage- readOnly: truecreator:allOf:- $ref: './link.yml'@@ -89,7 +74,6 @@ properties:The creator of the file link.**Resource**: User- readOnly: truedelete:allOf:- $ref: './link.yml'@@ -97,7 +81,6 @@ properties:The uri to delete the file link.**Resource**: N/A- readOnly: trueoriginOpen:allOf:- $ref: './link.yml'@@ -105,7 +88,6 @@ properties:The uri to open the origin file on the origin itself.**Resource**: N/A- readOnly: truestaticOriginOpen:allOf:- $ref: './link.yml'@@ -113,7 +95,6 @@ properties:A static uri to open the origin file on the storage. Responds with a redirect.**Resource**: N/A- readOnly: trueexample:id: 1337@@ -124,6 +105,7 @@ example:id: 5503name: logo.pngmimeType: image/png+ size: 16042createdAt: '2021-12-19T09:42:10.170Z'lastModifiedAt: '2021-12-20T14:00:13.987Z'createdByName: Luke Skywalkerdiff --git a/docs/api/apiv3/components/schemas/file_link_write_model.yml b/docs/api/apiv3/components/schemas/file_link_write_model.ymlnew file mode 100644index 00000000000..f596d148604--- /dev/null+++ b/docs/api/apiv3/components/schemas/file_link_write_model.yml@@ -0,0 +1,47 @@+# Schema: FileLinkWriteModel+---+type: object+required:+ - originData+ - _links+properties:+ originData:+ $ref: './file_link_origin_data_model.yml'+ _links:+ oneOf:+ - type: object+ required:+ - storage+ properties:+ storage:+ allOf:+ - $ref: './link.yml'+ - description: |-+ The storage resource of the linked file.++ **Resource**: Storage+ - type: object+ required:+ - storageUrl+ properties:+ storageUrl:+ allOf:+ - $ref: './link.yml'+ - description: |-+ The storage url the file link references to.++ **Resource**: N/A++example:+ originData:+ id: 5503+ name: logo.png+ mimeType: image/png+ size: 16042+ createdAt: '2021-12-19T09:42:10.170Z'+ lastModifiedAt: '2021-12-20T14:00:13.987Z'+ createdByName: Luke Skywalker+ lastModifiedByName: Anakin Skywalker+ _links:+ storageUrl:+ href: 'https://nextcloud.my-deathstar.org'diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.ymlindex 4c79b933724..4bae7131081 100644--- a/docs/api/apiv3/openapi-spec.yml+++ b/docs/api/apiv3/openapi-spec.yml@@ -521,12 +521,16 @@ components:"$ref": "./components/schemas/example_schema_model.yml"Execute_custom_action:"$ref": "./components/schemas/execute_custom_action.yml"- File_LinkModel:- "$ref": "./components/schemas/file_link_model.yml"- File_Link_Origin_DataModel:+ FileLinkCollectionReadModel:+ $ref: './components/schemas/file_link_collection_read_model.yml'+ FileLinkCollectionWriteModel:+ $ref: './components/schemas/file_link_collection_write_model.yml'+ FileLinkOriginDataModel:"$ref": "./components/schemas/file_link_origin_data_model.yml"- File_LinksModel:- "$ref": "./components/schemas/file_links_model.yml"+ FileLinkReadModel:+ $ref: './components/schemas/file_link_read_model.yml'+ FileLinkWriteModel:+ $ref: './components/schemas/file_link_write_model.yml'FormModel:"$ref": "./components/schemas/form_model.yml"Formattable:diff --git a/docs/api/apiv3/paths/file_link.yml b/docs/api/apiv3/paths/file_link.ymlindex 28f920b6b2e..261fa14a082 100644--- a/docs/api/apiv3/paths/file_link.yml+++ b/docs/api/apiv3/paths/file_link.yml@@ -22,7 +22,7 @@ get:content:application/hal+json:schema:- $ref: '../components/schemas/file_link_model.yml'+ $ref: '../components/schemas/file_link_read_model.yml''404':content:application/hal+json:diff --git a/docs/api/apiv3/paths/work_package_file_links.yml b/docs/api/apiv3/paths/work_package_file_links.ymlindex 3665252d102..6027b61cc85 100644--- a/docs/api/apiv3/paths/work_package_file_links.yml+++ b/docs/api/apiv3/paths/work_package_file_links.yml@@ -28,7 +28,7 @@ post:content:application/json:schema:- $ref: '../components/schemas/file_links_model.yml'+ $ref: '../components/schemas/file_link_collection_write_model.yml'example:_type: Collection_embedded:@@ -51,7 +51,7 @@ post:content:application/hal+json:schema:- $ref: '../components/schemas/file_links_model.yml'+ $ref: '../components/schemas/file_link_collection_read_model.yml''400':content:application/hal+json:@@ -125,7 +125,7 @@ get:content:application/hal+json:schema:- $ref: '../components/schemas/file_links_model.yml'+ $ref: '../components/schemas/file_link_collection_read_model.yml''403':content:application/hal+json: