openapi_first 4.2.0 → 4.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70cf5324252fd4c36421cb732127b220e45c3eefbafba7ed63ee513aea2d5b84
4
- data.tar.gz: 43358cb067c765b59920160f589eb929216a9721b806a4a37b24ab039f536599
3
+ metadata.gz: 20ff22852f152edfbbf62ad27d2672d286be8e07d9ec0d3a6a4a6b8d2608ea23
4
+ data.tar.gz: 4d956b76a491067d3c2a7d2d0716fbad834d62f6e7d643e9ac51c92938b6416b
5
5
  SHA512:
6
- metadata.gz: d1b97b74dcdf98616c0f51c3e6a2c53cedb3685518f9697491eadca4110d39f12f68c54769535e6d171bf401d8d47085279124d70534fb5959c47cdf3b4d4eda
7
- data.tar.gz: a27158cbd2760fa99de1f26193ce5450f5d2ef409c4a780da94ab102c24439dd1d149d6824a99cc8287617cd999cccc9de4989a33edaaaad2debfd7045a3892e
6
+ metadata.gz: 974432feb3f2b69cf7f1d613980d54bb2cbf25ae39ff09c2afc3f9aa0a8d4246bbd17c555ef7814533dcaee9ea9eee6d9aa9856a23b5869a2dcc61f8b5c06c32
7
+ data.tar.gz: 907638cdecc5ba7f0504a8a41555359db2a5dd924644495848836fc39e791624283050bdd7923afcd4eedf08a26fa5bb13b8ff06d91971033a4bb3a9507d3b53
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.2.1
6
+
7
+ - Fix deprecation warnings when using multi_json >= 1.21. openapi_first now uses `MultiJSON.parse`/`MultiJSON.generate` if available ([#508](https://github.com/ahx/openapi_first/issues/508)).
8
+
5
9
  ## 4.2.0
6
10
 
7
11
  - Added `config.regexp_resolver` configuration option, `'ruby'` (default) or `'ecma'` (also as Symbol). The value is passed to json_schemer's `regexp_resolver` configuration. In OpenAPI, the pattern keyword specifies a regular expression that must conform to the ECMA-262 standard. So using `'ecma'` is recommended.
@@ -1,22 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This tries to load MultiJson if available to keep compatibility
4
- # with MultiJson until next major version
4
+ # with MultiJson
5
5
 
6
6
  begin
7
7
  require 'multi_json'
8
+
8
9
  module OpenapiFirst
9
10
  # Compatibility with MultiJson
10
11
  # @visibility private
11
12
  module JSON
12
- ParserError = MultiJson::ParseError
13
-
14
- def self.parse(string)
15
- MultiJson.load(string)
16
- end
17
-
18
- def self.generate(object)
19
- MultiJson.dump(object)
13
+ if defined?(::MultiJSON)
14
+ # multi_json >= 1.21.0
15
+ ParserError = MultiJSON::ParseError
16
+ def self.parse(string) = MultiJSON.parse(string)
17
+ def self.generate(object) = MultiJSON.generate(object)
18
+ else
19
+ # multi_json < 1.21.0
20
+ ParserError = MultiJson::ParseError
21
+ def self.parse(string) = MultiJson.load(string)
22
+ def self.generate(object) = MultiJson.dump(object)
20
23
  end
21
24
  end
22
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiFirst
4
- VERSION = '4.2.0'
4
+ VERSION = '4.2.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openapi_first
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Haller