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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/openapi_first/json.rb +12 -9
- data/lib/openapi_first/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20ff22852f152edfbbf62ad27d2672d286be8e07d9ec0d3a6a4a6b8d2608ea23
|
|
4
|
+
data.tar.gz: 4d956b76a491067d3c2a7d2d0716fbad834d62f6e7d643e9ac51c92938b6416b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/openapi_first/json.rb
CHANGED
|
@@ -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
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
MultiJson
|
|
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
|