diff --git a/lib/api/v3/utilities/path_helper.rb b/lib/api/v3/utilities/path_helper.rb index 93b9b38344..5e7fa437d7 100644 --- a/lib/api/v3/utilities/path_helper.rb +++ b/lib/api/v3/utilities/path_helper.rb @@ -104,10 +104,6 @@ module API render_markup(format: :textile, link: link) end - def self.schema(project_id, type_id) - "#{root}/work_packages/schemas/#{project_id}-#{type_id}" - end - def self.statuses "#{root}/statuses" end @@ -160,6 +156,10 @@ module API "#{work_package(id)}/activities" end + def self.work_package_form(id) + "#{work_package(id)}/form" + end + def self.work_package_relations(id) "#{work_package(id)}/relations" end @@ -168,8 +168,8 @@ module API "#{work_package_relations(work_package_id)}/#{id}" end - def self.work_package_form(id) - "#{work_package(id)}/form" + def self.work_package_schema(project_id, type_id) + "#{root}/work_packages/schemas/#{project_id}-#{type_id}" end def self.work_package_watchers(id) diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb index cb70760dbf..7f80d4848d 100644 --- a/lib/api/v3/work_packages/work_package_representer.rb +++ b/lib/api/v3/work_packages/work_package_representer.rb @@ -46,7 +46,7 @@ module API link :schema do { - href: api_v3_paths.schema(represented.project.id, represented.type.id) + href: api_v3_paths.work_package_schema(represented.project.id, represented.type.id) } end diff --git a/spec/lib/api/v3/utilities/path_helper_spec.rb b/spec/lib/api/v3/utilities/path_helper_spec.rb index 1b71e3b9e9..bf0955689f 100644 --- a/spec/lib/api/v3/utilities/path_helper_spec.rb +++ b/spec/lib/api/v3/utilities/path_helper_spec.rb @@ -204,8 +204,8 @@ describe ::API::V3::Utilities::PathHelper do end describe 'schemas paths' do - describe '#schema' do - subject { helper.schema 1, 2 } + describe '#work_package_schema' do + subject { helper.work_package_schema 1, 2 } it_behaves_like 'api v3 path'