apimatic_core 0.3.16 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -4
- data/lib/apimatic-core/api_call.rb +6 -0
- data/lib/apimatic-core/utilities/api_helper.rb +18 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b0a483f088067743a544f3de82e94a1fd7e69c8ae909183b78f4d1ef5b1ae58
|
4
|
+
data.tar.gz: cd450513cff448d0a5c26ab010965d1a6c96c69aaa4d28867a4837b23860ddd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e979257d3120334ba5b91869185aabb76a370d9fb7e8dff380d11275be052dcee00162b46e72e426812f4228b0c93fb7eda06bdc12ecdfce931b2529d00475ec
|
7
|
+
data.tar.gz: 2adbc4d4e20342ff76a26b90225a6cce77e0ff7ba2a6ee0d7e1904682369a561c513a5b6fe9668ed0fd801ec49d445d496f520ddc9b96e05934dabd1ee7d3d53
|
data/README.md
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
[](https://badge.fury.io/rb/apimatic_core)
|
4
4
|
[![Tests][test-badge]][test-url]
|
5
5
|
[![Linting][lint-badge]][lint-url]
|
6
|
-
[![Test Coverage][
|
6
|
+
[![Test Coverage][coverage-badge]][coverage-url]
|
7
|
+
[![Maintainability Rating][maintainability-badge]][maintainability-url]
|
8
|
+
[![Vulnerabilities][vulnerabilities-badge]][vulnerabilities-url]
|
7
9
|
[](https://github.com/rubocop/rubocop)
|
8
10
|
[![Licence][license-badge]][license-url]
|
9
11
|
|
@@ -125,8 +127,11 @@ gem 'apimatic_core'
|
|
125
127
|
[test-url]: https://github.com/apimatic/core-lib-ruby/actions/workflows/test-runner.yml
|
126
128
|
[lint-badge]: https://github.com/apimatic/core-lib-ruby/actions/workflows/lint-runner.yml/badge.svg
|
127
129
|
[lint-url]: https://github.com/apimatic/core-lib-ruby/actions/workflows/lint-runner.yml
|
128
|
-
[
|
129
|
-
[
|
130
|
-
[
|
130
|
+
[coverage-badge]: https://sonarcloud.io/api/project_badges/measure?project=apimatic_core-lib-ruby&metric=coverage
|
131
|
+
[coverage-url]: https://sonarcloud.io/summary/new_code?id=apimatic_core-lib-ruby
|
132
|
+
[maintainability-badge]: https://sonarcloud.io/api/project_badges/measure?project=apimatic_core-lib-ruby&metric=sqale_rating
|
133
|
+
[maintainability-url]: https://sonarcloud.io/summary/new_code?id=apimatic_core-lib-ruby
|
134
|
+
[vulnerabilities-badge]: https://sonarcloud.io/api/project_badges/measure?project=apimatic_core-lib-ruby&metric=vulnerabilities
|
135
|
+
[vulnerabilities-url]: https://sonarcloud.io/summary/new_code?id=apimatic_core-lib-ruby
|
131
136
|
[license-badge]: https://img.shields.io/badge/licence-MIT-blue
|
132
137
|
[license-url]: LICENSE
|
@@ -3,6 +3,12 @@ module CoreLibrary
|
|
3
3
|
class ApiCall
|
4
4
|
attr_reader :request_builder, :pagination_strategy_list, :global_configuration
|
5
5
|
|
6
|
+
# Creates a new builder instance of the API call with pre-configured global and logging configurations.
|
7
|
+
# @return [ApiCall] The instance of ApiCall object.
|
8
|
+
def new_builder
|
9
|
+
ApiCall.new(@global_configuration)
|
10
|
+
end
|
11
|
+
|
6
12
|
# Initializes a new instance of ApiCall.
|
7
13
|
# @param [GlobalConfiguration] global_configuration An instance of GlobalConfiguration.
|
8
14
|
def initialize(global_configuration)
|
@@ -72,8 +72,11 @@ module CoreLibrary
|
|
72
72
|
|
73
73
|
# Deserializer to use when the type of response is not known beforehand.
|
74
74
|
# @param response The response received.
|
75
|
+
# @return [Hash, Array, nil] The deserialized response.
|
75
76
|
def self.dynamic_deserializer(response, should_symbolize)
|
76
|
-
|
77
|
+
return unless deserializable_json?(response)
|
78
|
+
|
79
|
+
json_deserialize(response, should_symbolize)
|
77
80
|
end
|
78
81
|
|
79
82
|
# Deserializes response to a known custom model type.
|
@@ -303,6 +306,20 @@ module CoreLibrary
|
|
303
306
|
end
|
304
307
|
end
|
305
308
|
|
309
|
+
# Checks whether the content is deserializable JSON.
|
310
|
+
# @param [String] json A JSON string.
|
311
|
+
# @return [Boolean] True if the content can be deserialized, false otherwise.
|
312
|
+
def self.deserializable_json?(json)
|
313
|
+
return false if json.nil? || json.to_s.strip.empty?
|
314
|
+
|
315
|
+
begin
|
316
|
+
JSON.parse(json)
|
317
|
+
true
|
318
|
+
rescue JSON::ParserError
|
319
|
+
false
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
306
323
|
# Parses JSON string.
|
307
324
|
# @param [object] obj The object to serialize.
|
308
325
|
def self.json_serialize(obj)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apimatic_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- APIMatic Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apimatic_core_interfaces
|