openapi_first 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de3cced92ef56a41399e4baa7aaf2b42250d2d3e532a22b245edd70d2b7446d2
4
- data.tar.gz: b433a7d18c02176dda8ce12ff41636d4f19bd99632cbc0085879e34b3090cb76
3
+ metadata.gz: 543c0103c059d292d91db5a177e4a2fec307473b0438b2b851d96f2818920a9c
4
+ data.tar.gz: b98142de184e58931bc544aa867cf4700605164fbfe2b426e074732dd37f293e
5
5
  SHA512:
6
- metadata.gz: 58613cfd3648073dee3189cfced111adcdfd4471ee67a07517d3c800c69aded0ab46b50a69d56fda453a2af9078db74ee45c260c601c16cdd2896428d330068b
7
- data.tar.gz: ae57aa8b109569165e9bb9ce3e9eb380e387a0eb1afb3cde850f7a2d3979391dc62ebe567cacb51492aefe4d9ef2db2db8963c4ca2b256cbf0c5b3e9491a2de3
6
+ metadata.gz: 19cec612f7336c745bbccff2a518f65ce9785d9b4f4b237adb3b4bf6b5198eaa2e52c6eefce79eec748a627e99a6d58c41a648f95e66065b9bb9c01ed188fd58
7
+ data.tar.gz: 7350acd1b0a7e4b7ca34c9c0ad2e7e18096b344c2bec42af12c140271eb55765ea73d9fbd39808d919c6a6d061b4759a0323c647bd5b7a42f104efa72d0638f8
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.2.3
6
+
7
+ - Respect global JSONSchemer configuration (https://github.com/ahx/openapi_first/pull/318)
8
+
5
9
  ## 2.2.2
6
10
 
7
11
  - Fix parsing parameters with referenced schemas (https://github.com/ahx/openapi_first/issues/316)
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json_schemer'
4
- require_relative 'json_pointer'
5
4
  require_relative 'ref_resolver'
6
5
 
7
6
  module OpenapiFirst
@@ -18,10 +17,10 @@ module OpenapiFirst
18
17
  end
19
18
 
20
19
  def initialize(contents, filepath:, config:)
21
- @schemer_configuration = JSONSchemer::Configuration.new(
22
- meta_schema: detect_meta_schema(contents, filepath),
23
- insert_property_defaults: true
24
- )
20
+ @schemer_configuration = JSONSchemer.configuration.clone
21
+ @schemer_configuration.meta_schema = detect_meta_schema(contents, filepath)
22
+ @schemer_configuration.insert_property_defaults = true
23
+
25
24
  @config = config
26
25
  @contents = RefResolver.for(contents, dir: filepath && File.dirname(filepath))
27
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiFirst
4
- VERSION = '2.2.2'
4
+ VERSION = '2.2.3'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openapi_first
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Haller
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-21 00:00:00.000000000 Z
10
+ date: 2025-01-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: hana
@@ -104,7 +104,6 @@ files:
104
104
  - lib/openapi_first/failure.rb
105
105
  - lib/openapi_first/file_loader.rb
106
106
  - lib/openapi_first/json.rb
107
- - lib/openapi_first/json_pointer.rb
108
107
  - lib/openapi_first/middlewares/request_validation.rb
109
108
  - lib/openapi_first/middlewares/response_validation.rb
110
109
  - lib/openapi_first/ref_resolver.rb
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module OpenapiFirst
4
- # Functions to handle JSON Pointers
5
- # @!visibility private
6
- module JsonPointer
7
- ESCAPE_CHARS = { '~' => '~0', '/' => '~1', '+' => '%2B' }.freeze
8
- ESCAPE_REGEX = Regexp.union(ESCAPE_CHARS.keys)
9
-
10
- module_function
11
-
12
- def append(root, *tokens)
13
- "#{root}/" + tokens.map do |token|
14
- escape_json_pointer_token(token)
15
- end.join('/')
16
- end
17
-
18
- def escape_json_pointer_token(token)
19
- token.to_s.gsub(ESCAPE_REGEX, ESCAPE_CHARS)
20
- end
21
- end
22
- end