From be546c9170859efc3c482ab17f350826d5d07cac Mon Sep 17 00:00:00 2001 From: Cody Gustafson Date: Fri, 4 Nov 2022 17:07:59 -0500 Subject: [PATCH 1/4] Add RESO versioning We should be able to alter the version of the RESO Web API we are hitting. This change should allow for that using the already existing `version` configuration option. That option was initially spark-only since the RESO Web API did not exist yet. --- lib/spark_api/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spark_api/request.rb b/lib/spark_api/request.rb index 5adb5ad..3cad91d 100644 --- a/lib/spark_api/request.rb +++ b/lib/spark_api/request.rb @@ -83,7 +83,7 @@ def request(method, path, body, options) request_opts.merge!(options) request_path = if middleware && middleware.to_sym == :reso_api dd_version = "Dictionary/#{dictionary_version}/" unless dictionary_version.nil? - "/Reso/#{dd_version}OData#{path}" + "/Version/#{version}/Reso/#{dd_version}OData#{path}" else "/#{version}#{path}" end From cacb2cd837825b3085f69d38ce7860914bbba795 Mon Sep 17 00:00:00 2001 From: Cody Gustafson Date: Fri, 4 Nov 2022 17:10:56 -0500 Subject: [PATCH 2/4] Update CHANGELOG and VERSION --- CHANGELOG | 3 +++ VERSION | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9bc0830..8228327 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +v1.6.2 + - Add support for versioning the RESO Web API + v1.6.1 - forward port of v1.5.7 - add addressable as a named runtime dependency (fixes regression from diff --git a/VERSION b/VERSION index 9c6d629..fdd3be6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.1 +1.6.2 From d365d1a9de6a37244f247b5bf2f53fad4694677f Mon Sep 17 00:00:00 2001 From: Cody Gustafson Date: Mon, 7 Nov 2022 11:49:30 -0600 Subject: [PATCH 3/4] Do not use default version for RESO Web API --- lib/spark_api/request.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/spark_api/request.rb b/lib/spark_api/request.rb index 3cad91d..0727ee1 100644 --- a/lib/spark_api/request.rb +++ b/lib/spark_api/request.rb @@ -83,7 +83,8 @@ def request(method, path, body, options) request_opts.merge!(options) request_path = if middleware && middleware.to_sym == :reso_api dd_version = "Dictionary/#{dictionary_version}/" unless dictionary_version.nil? - "/Version/#{version}/Reso/#{dd_version}OData#{path}" + reso_version = "/Version/#{version}" unless version == SparkApi::Configuration::DEFAULT_VERSION + "#{reso_version}/Reso/#{dd_version}OData#{path}" else "/#{version}#{path}" end From 503abb69577134761f033a34ebc620c627abc477 Mon Sep 17 00:00:00 2001 From: Cody Gustafson Date: Mon, 7 Nov 2022 11:55:38 -0600 Subject: [PATCH 4/4] account for an unset version --- lib/spark_api/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spark_api/request.rb b/lib/spark_api/request.rb index 0727ee1..2ece326 100644 --- a/lib/spark_api/request.rb +++ b/lib/spark_api/request.rb @@ -83,7 +83,7 @@ def request(method, path, body, options) request_opts.merge!(options) request_path = if middleware && middleware.to_sym == :reso_api dd_version = "Dictionary/#{dictionary_version}/" unless dictionary_version.nil? - reso_version = "/Version/#{version}" unless version == SparkApi::Configuration::DEFAULT_VERSION + reso_version = "/Version/#{version}" unless version == SparkApi::Configuration::DEFAULT_VERSION || version.nil? "#{reso_version}/Reso/#{dd_version}OData#{path}" else "/#{version}#{path}"