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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/openapi_first/builder.rb +4 -5
- data/lib/openapi_first/version.rb +1 -1
- metadata +2 -3
- data/lib/openapi_first/json_pointer.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 543c0103c059d292d91db5a177e4a2fec307473b0438b2b851d96f2818920a9c
|
4
|
+
data.tar.gz: b98142de184e58931bc544aa867cf4700605164fbfe2b426e074732dd37f293e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19cec612f7336c745bbccff2a518f65ce9785d9b4f4b237adb3b4bf6b5198eaa2e52c6eefce79eec748a627e99a6d58c41a648f95e66065b9bb9c01ed188fd58
|
7
|
+
data.tar.gz: 7350acd1b0a7e4b7ca34c9c0ad2e7e18096b344c2bec42af12c140271eb55765ea73d9fbd39808d919c6a6d061b4759a0323c647bd5b7a42f104efa72d0638f8
|
data/CHANGELOG.md
CHANGED
@@ -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
|
22
|
-
|
23
|
-
|
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
|
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.
|
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-
|
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
|