Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Use "public-api" for URI instead of version no
Browse files Browse the repository at this point in the history
Brightpearl are deprecating the use of specific version numbers in the URI for their public API. Instead, you should use "public-api" in the same location within the URI.

- Change "2.0.0" to "public-api".
- Don't allow this change to be overridden in configuration.

This change will result in the config ignoring API versions being set, so the change is non-breaking.

I have tested the new URI's and they work.
  • Loading branch information
allolex committed Feb 7, 2016
1 parent 7574823 commit 54eefb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/nacre/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def default_distribution_center
end

def default_api_version
ENV["NACRE_API_VERSION"] || "2.0.0"
"public-api"
end

def default_user_id
Expand Down
3 changes: 1 addition & 2 deletions spec/lib/nacre/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

describe Nacre::Configuration do


let(:config) { Nacre::Configuration.new(args) }

let(:args) { {} }
Expand Down Expand Up @@ -31,7 +30,7 @@
end

it "should have the correct Resource URL" do
expect(config.resource_url).to eql("https://ws-eu1.brightpearl.com/2.0.0/%s" % [ENV["NACRE_USER_ID"]])
expect(config.resource_url).to eql("https://ws-eu1.brightpearl.com/public-api/%s" % [ENV["NACRE_USER_ID"]])
end

it "should have the correct auth URL" do
Expand Down

0 comments on commit 54eefb6

Please sign in to comment.