Skip to content

Commit 94f395e

Browse files
committed
feat(versions resource): deprecate versions and pacticipant links in favour of pb:versions and pb:pacticipants
1 parent 477021c commit 94f395e

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

lib/pact_broker/api/decorators/versions_decorator.rb

+17-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
require_relative 'version_decorator'
33

44
module PactBroker
5-
65
module Api
7-
86
module Decorators
9-
10-
117
class VersionsDecorator < BaseDecorator
128

139
collection :entries, as: :versions, embedded: true, :extend => PactBroker::Api::Decorators::VersionDecorator
@@ -19,14 +15,14 @@ class VersionsDecorator < BaseDecorator
1915
}
2016
end
2117

22-
link :pacticipant do | context |
18+
link :'pb:pacticipant' do | context |
2319
{
2420
href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])),
2521
title: context[:pacticipant_name]
2622
}
2723
end
2824

29-
links :'versions' do | context |
25+
links :'pb:versions' do | context |
3026
represented.collect do | version |
3127
{
3228
:href => version_url(context[:base_url], version),
@@ -35,6 +31,21 @@ class VersionsDecorator < BaseDecorator
3531
end
3632
end
3733

34+
link :pacticipant do | context |
35+
{
36+
href: pacticipant_url(context[:base_url], OpenStruct.new(name: context[:pacticipant_name])),
37+
title: 'Deprecated - please use pb:pacticipant'
38+
}
39+
end
40+
41+
links :'versions' do | context |
42+
represented.collect do | version |
43+
{
44+
:href => version_url(context[:base_url], version),
45+
:title => 'Deprecated - please use pb:versions'
46+
}
47+
end
48+
end
3849
end
3950
end
4051
end

0 commit comments

Comments
 (0)