add parentId field to schema

This is somewhat debateable. Having a parentId field is wrong in itself. It should be a linked resource. But as the field is also present in the resource, it also needs to be part of the schema for consistency sake.
pull/3997/head
Jens Ulferts 9 years ago
parent 6d8fac2f65
commit 966d749e45
  1. 5
      lib/api/v3/work_packages/schema/work_package_schema_representer.rb
  2. 10
      spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb

@ -114,6 +114,11 @@ module API
schema :project,
type: 'Project'
schema :parent_id,
type: 'Integer',
required: false,
writable: true
schema_with_allowed_link :assignee,
type: 'User',
required: false,

@ -370,6 +370,16 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter do
end
end
describe 'parentId' do
it_behaves_like 'has basic schema properties' do
let(:path) { 'parentId' }
let(:type) { 'Integer' }
let(:name) { I18n.t('activerecord.attributes.work_package.parent') }
let(:required) { false }
let(:writable) { true }
end
end
describe 'type' do
it_behaves_like 'has basic schema properties' do
let(:path) { 'type' }

Loading…
Cancel
Save