Skip to content

Commit

Permalink
fix: set correct Accept header when publishing provider contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 25, 2023
1 parent a174023 commit abc8ea3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/pacts/markdown/Pact Broker Client - Pactflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Upon receiving **a request to publish a provider contract** from Pact Broker Cli
"path": "/HAL-REL-PLACEHOLDER-PF-PUBLISH-PROVIDER-CONTRACT-Bar",
"headers": {
"Content-Type": "application/json",
"Accept": "application/hal+json"
"Accept": "application/hal+json,application/problem+json"
},
"body": {
"pacticipantVersionNumber": "1",
Expand Down
2 changes: 1 addition & 1 deletion lib/pactflow/client/provider_contracts/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def disabled?
end

def publish_provider_contracts
@response_entity = index_resource._link(PUBLISH_RELATION).expand(provider: provider_name).post!(contract_params, headers: { "Accept" => "application/hal+json,application/problem+json" })
@response_entity = index_resource._link(PUBLISH_RELATION).expand(provider: provider_name).post!(contract_params, { "Accept" => "application/hal+json,application/problem+json" })
end

def contract_params
Expand Down
1 change: 0 additions & 1 deletion script/publish-provider-contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ bundle exec bin/pactflow publish-provider-contract \
--branch main \
--tag dev \
--specification oas \
--content-type application/yml \
--verification-exit-code 0 \
--verification-results script/verification-results.txt \
--verification-results-content-type text/plain \
Expand Down
2 changes: 1 addition & 1 deletion spec/pacts/pact_broker_client-pactflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"path": "/HAL-REL-PLACEHOLDER-PF-PUBLISH-PROVIDER-CONTRACT-Bar",
"headers": {
"Content-Type": "application/json",
"Accept": "application/hal+json"
"Accept": "application/hal+json,application/problem+json"
},
"body": {
"pacticipantVersionNumber": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
.with(
method: :post,
path: placeholder_path("pf:publish-provider-contract", ["Bar"]),
headers: post_request_headers,
headers: post_request_headers.merge("Accept" => "application/hal+json,application/problem+json"),
body: request_body
).will_respond_with(success_response)
end
Expand Down

0 comments on commit abc8ea3

Please sign in to comment.