lib/pact_broker/api/resources/pact.rb in pact_broker-1.15.0 vs lib/pact_broker/api/resources/pact.rb in pact_broker-1.16.0
- old
+ new
@@ -22,11 +22,12 @@
class Pact < BaseResource
include PacticipantResourceMethods
def content_types_provided
- [["application/json", :to_json]]
+ [["application/json", :to_json],
+ ["text/html", :to_html]]
end
def content_types_accepted
[["application/json", :from_json]]
end
@@ -72,9 +73,13 @@
response_code
end
def to_json
PactBroker::Api::Decorators::PactDecorator.new(pact).to_json(user_options: { base_url: base_url })
+ end
+
+ def to_html
+ PactBroker.configuration.html_pact_renderer.call(pact)
end
def delete_resource
pact_service.delete(pact_params)
true