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
Added self link to StorageFile API representation
Andreas Pfohl2554e265c44a
diff --git a/docs/api/apiv3/components/schemas/file_collection_model.yml b/docs/api/apiv3/components/schemas/file_collection_model.ymlindex 934a01fe35b..acde99e41f2 100644--- a/docs/api/apiv3/components/schemas/file_collection_model.yml+++ b/docs/api/apiv3/components/schemas/file_collection_model.yml@@ -47,6 +47,9 @@ example:lastModifiedAt: '2021-12-20T14:00:13.987Z'createdByName: Luke SkywalkerlastModifiedByName: Anakin Skywalker+ _links:+ self:+ href: 'urn:openproject-org:api:v3:storages:storage_file:no_link_provided'- id: 1338location: '1338'name: README.md@@ -56,3 +59,6 @@ example:lastModifiedAt: '2021-12-21T14:00:13.987Z'createdByName: Leia OrganalastModifiedByName: Leia Organa+ _links:+ self:+ href: 'urn:openproject-org:api:v3:storages:storage_file:no_link_provided'diff --git a/docs/api/apiv3/components/schemas/storage_file_location_model.yml b/docs/api/apiv3/components/schemas/storage_file_location_model.ymlindex 3bfe1122a45..367afb2cad1 100644--- a/docs/api/apiv3/components/schemas/storage_file_location_model.yml+++ b/docs/api/apiv3/components/schemas/storage_file_location_model.yml@@ -7,3 +7,16 @@ properties:location:type: stringdescription: Location identification for file in storage+ _links:+ type: object+ required:+ - self+ properties:+ self:+ allOf:+ - "$ref": "./link.yml"+ - description: |-+ Not provided++ **Resource**: urn:openproject-org:api:v3:storages:storage_file:no_link_provided+ readOnly: truediff --git a/modules/storages/lib/api/v3/storage_files/storage_file_representer.rb b/modules/storages/lib/api/v3/storage_files/storage_file_representer.rbindex dde6f36c54d..adbb49e5bf3 100644--- a/modules/storages/lib/api/v3/storage_files/storage_file_representer.rb+++ b/modules/storages/lib/api/v3/storage_files/storage_file_representer.rb@@ -30,6 +30,10 @@ module API::V3::StorageFilesclass StorageFileRepresenter < ::API::Decorators::Singleinclude API::Decorators::DateProperty+ link :self do+ { href: "#{::API::V3::URN_PREFIX}storages:storage_file:no_link_provided" }+ end+property :idproperty :nameproperty :size@@ -41,7 +45,7 @@ module API::V3::StorageFilesproperty :locationdef _type- 'StorageFile'+ Storages::StorageFile.class.to_sendendend