skooma 0.2.2 → 0.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 +12 -1
- data/lib/skooma/matchers/be_valid_document.rb +2 -0
- data/lib/skooma/matchers/conform_request_schema.rb +2 -0
- data/lib/skooma/matchers/wrapper.rb +4 -2
- data/lib/skooma/objects/parameter/keywords/content.rb +1 -0
- data/lib/skooma/objects/parameter/keywords/required.rb +1 -0
- data/lib/skooma/objects/parameter/keywords/value_parser.rb +1 -1
- data/lib/skooma/version.rb +1 -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: 6263d8960b9a3b49287103608c6770c967b6fadfcf58d826df2a492c4dedbd35
|
4
|
+
data.tar.gz: 5dd2c141d4baa7f0b95c1b3f3fbfd1afdafaae0097a1139956ba1c7e45f876a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ddc4010685045a5b2a9908597096af07fb5ac21cce3e1c456568111fed4fc2fb708603be0a47dbd6e61bec0d64e0d85e27841ab36583f0fb61b73759d3f05b
|
7
|
+
data.tar.gz: 1210a2ed7f56206369242baa147795acd3a6bc77aa6b719cb3ccc26ab33367a775921d0d94fd8741b651274afdc9183c20af194e4a289190d5968de239a9ae56
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning].
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.2.3] - 2024-01-18
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Add support for multiple OpenAPI documents. ([@skryukov])
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Fix `Skooma::Error: Missing name key /request` by setting `content` and `required` keyword dependencies. ([@skryukov])
|
19
|
+
|
10
20
|
## [0.2.2] - 2024-01-04
|
11
21
|
|
12
22
|
### Added
|
@@ -59,7 +69,8 @@ end
|
|
59
69
|
|
60
70
|
[@skryukov]: https://github.com/skryukov
|
61
71
|
|
62
|
-
[Unreleased]: https://github.com/skryukov/skooma/compare/v0.2.
|
72
|
+
[Unreleased]: https://github.com/skryukov/skooma/compare/v0.2.3...HEAD
|
73
|
+
[0.2.3]: https://github.com/skryukov/skooma/compare/v0.2.2...v0.2.3
|
63
74
|
[0.2.2]: https://github.com/skryukov/skooma/compare/v0.2.1...v0.2.2
|
64
75
|
[0.2.1]: https://github.com/skryukov/skooma/compare/v0.2.0...v0.2.1
|
65
76
|
[0.2.0]: https://github.com/skryukov/skooma/compare/v0.1.0...v0.2.0
|
@@ -45,11 +45,13 @@ module Skooma
|
|
45
45
|
|
46
46
|
registry = create_test_registry
|
47
47
|
pathname = Pathname.new(openapi_path)
|
48
|
+
source_uri = "#{base_uri}#{path_prefix.delete_suffix("/")}"
|
49
|
+
source_uri += "/" unless source_uri.end_with?("/")
|
48
50
|
registry.add_source(
|
49
|
-
|
51
|
+
source_uri,
|
50
52
|
JSONSkooma::Sources::Local.new(pathname.dirname.to_s)
|
51
53
|
)
|
52
|
-
schema = registry.schema(URI.parse("#{
|
54
|
+
schema = registry.schema(URI.parse("#{source_uri}#{pathname.basename}"), schema_class: Skooma::Objects::OpenAPI)
|
53
55
|
schema.path_prefix = path_prefix
|
54
56
|
|
55
57
|
include DefaultHelperMethods
|
@@ -8,6 +8,7 @@ module Skooma
|
|
8
8
|
self.key = "content"
|
9
9
|
self.value_schema = :object_of_schemas
|
10
10
|
self.schema_value_class = Objects::MediaType
|
11
|
+
self.depends_on = %w[in name style explode allowReserved allowEmptyValue]
|
11
12
|
|
12
13
|
def evaluate(instance, result)
|
13
14
|
return if instance.value.nil?
|
@@ -6,6 +6,7 @@ module Skooma
|
|
6
6
|
module Keywords
|
7
7
|
class Required < JSONSkooma::Keywords::Base
|
8
8
|
self.key = "required"
|
9
|
+
self.depends_on = %w[in name style explode allowReserved allowEmptyValue]
|
9
10
|
|
10
11
|
def evaluate(instance, result)
|
11
12
|
if json.value && ValueParser.call(instance, result)&.value.nil?
|
@@ -13,7 +13,7 @@ module Skooma
|
|
13
13
|
raise Error, "Missing `in` key #{result.path}" unless type
|
14
14
|
|
15
15
|
key = result.sibling(instance, "name")&.annotation
|
16
|
-
raise Error, "Missing `name` key #{
|
16
|
+
raise Error, "Missing `name` key #{result.path}" unless key
|
17
17
|
|
18
18
|
case type
|
19
19
|
when "query"
|
data/lib/skooma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skooma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svyatoslav Kryukov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|