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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d780ea317b116a8bdafac72f240b68366cf6f2892ea671f29ed51dd48a198093
4
- data.tar.gz: '078593785c8fc17c73c171616131880dbeaf1b85923e593a3612eb9b2309ff0d'
3
+ metadata.gz: 6263d8960b9a3b49287103608c6770c967b6fadfcf58d826df2a492c4dedbd35
4
+ data.tar.gz: 5dd2c141d4baa7f0b95c1b3f3fbfd1afdafaae0097a1139956ba1c7e45f876a1
5
5
  SHA512:
6
- metadata.gz: f16cb70ad584c45615c4c376ebbab69e48caca0daa32c687d55c9c96453b3a608096afeedc45a7286e0e4ace4c2dc500c2d36ed013d0b951d915b60bbba42a63
7
- data.tar.gz: c301176ff04134e0e6d18c57e4e0ced55f1dca82d8ff807eefa820cc02f8227101275ccf43b4e3b60c6716b19d7da94f714da37435f417995e97faf44f2b20d3
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.2...HEAD
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
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pp"
4
+
3
5
  module Skooma
4
6
  module Matchers
5
7
  class BeValidDocument
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pp"
4
+
3
5
  module Skooma
4
6
  module Matchers
5
7
  class ConformRequestSchema
@@ -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
- base_uri,
51
+ source_uri,
50
52
  JSONSkooma::Sources::Local.new(pathname.dirname.to_s)
51
53
  )
52
- schema = registry.schema(URI.parse("#{base_uri}#{pathname.basename}"), schema_class: Skooma::Objects::OpenAPI)
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 #{instance.path}: #{key}" unless key
16
+ raise Error, "Missing `name` key #{result.path}" unless key
17
17
 
18
18
  case type
19
19
  when "query"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Skooma
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
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.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-04 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk