skooma 0.3.6 → 0.3.7

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.
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "https://spec.openapis.org/oas/3.1/schema-base/2025-09-15",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "description": "The description of OpenAPI v3.1.x Documents using the OpenAPI JSON Schema dialect",
5
+ "$ref": "https://spec.openapis.org/oas/3.1/schema/2025-09-15",
6
+ "properties": {
7
+ "jsonSchemaDialect": {
8
+ "$ref": "#/$defs/dialect"
9
+ }
10
+ },
11
+ "$defs": {
12
+ "dialect": {
13
+ "const": "https://spec.openapis.org/oas/3.1/dialect/2024-11-10"
14
+ },
15
+ "schema": {
16
+ "$dynamicAnchor": "meta",
17
+ "$ref": "https://spec.openapis.org/oas/3.1/dialect/2024-11-10",
18
+ "properties": {
19
+ "$schema": {
20
+ "$ref": "#/$defs/dialect"
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "https://spec.openapis.org/oas/3.2/schema-base/2025-09-17",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "description": "The description of OpenAPI v3.2.x Documents using the OpenAPI JSON Schema dialect",
5
+ "$ref": "https://spec.openapis.org/oas/3.2/schema/2025-09-17",
6
+ "properties": {
7
+ "jsonSchemaDialect": {
8
+ "$ref": "#/$defs/dialect"
9
+ }
10
+ },
11
+ "$defs": {
12
+ "dialect": {
13
+ "const": "https://spec.openapis.org/oas/3.2/dialect/2025-09-17"
14
+ },
15
+ "schema": {
16
+ "$dynamicAnchor": "meta",
17
+ "$ref": "https://spec.openapis.org/oas/3.2/dialect/2025-09-17",
18
+ "properties": {
19
+ "$schema": {
20
+ "$ref": "#/$defs/dialect"
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
@@ -40,6 +40,7 @@ module Skooma
40
40
  status, headers, body = response.to_a
41
41
  full_body = +""
42
42
  body.each { |chunk| full_body << chunk }
43
+
43
44
  {
44
45
  "status" => status,
45
46
  "headers" => headers.to_h,
@@ -5,7 +5,17 @@ module Skooma
5
5
  class ConformResponseSchema < ConformRequestSchema
6
6
  def initialize(skooma, mapped_response, expected)
7
7
  super(skooma, mapped_response)
8
+
8
9
  @expected = expected
10
+
11
+ case expected
12
+ when Symbol
13
+ @expected_code = Rack::Utils::SYMBOL_TO_STATUS_CODE.fetch(expected)
14
+ when Integer
15
+ @expected_code = expected
16
+ else
17
+ raise ArgumentError, "Expected symbol or number, got expected=#{expected.inspect}"
18
+ end
9
19
  end
10
20
 
11
21
  def description
@@ -7,16 +7,21 @@ module Skooma
7
7
  class OpenAPI < JSONSkooma::Keywords::BaseAnnotation
8
8
  self.key = "openapi"
9
9
 
10
+ MAPPING = {
11
+ "3.1.0" => "https://spec.openapis.org/oas/3.1/schema-base/2022-10-07",
12
+ "3.1.1" => "https://spec.openapis.org/oas/3.1/schema-base/2025-02-13",
13
+ "3.1.2" => "https://spec.openapis.org/oas/3.1/schema-base/2025-09-15",
14
+ "3.2.0" => "https://spec.openapis.org/oas/3.1/schema-base/2025-09-17"
15
+ }
16
+
17
+ LATEST = "3.2.0"
18
+
10
19
  def initialize(parent_schema, value)
11
20
  unless value.to_s.start_with? "3.1."
12
21
  raise Error, "Only OpenAPI version 3.1.x is supported, got #{value}"
13
22
  end
14
23
 
15
- parent_schema.metaschema_uri = if value.to_s.start_with? "3.1.0"
16
- "https://spec.openapis.org/oas/3.1/schema-base/2022-10-07"
17
- else
18
- "https://spec.openapis.org/oas/3.1/schema-base/2025-02-13"
19
- end
24
+ parent_schema.metaschema_uri = MAPPING[value.to_s] || MAPPING[LATEST]
20
25
 
21
26
  parent_schema.json_schema_dialect_uri = "https://spec.openapis.org/oas/3.1/dialect/base"
22
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Skooma
4
- VERSION = "0.3.6"
4
+ VERSION = "0.3.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skooma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svyatoslav Kryukov
@@ -48,13 +48,19 @@ files:
48
48
  - LICENSE.txt
49
49
  - README.md
50
50
  - data/oas-3.1/dialect/2024-11-10.json
51
+ - data/oas-3.1/dialect/2025-09-17.json
51
52
  - data/oas-3.1/dialect/base.json
52
53
  - data/oas-3.1/meta/2024-11-10.json
54
+ - data/oas-3.1/meta/2025-09-17.json
53
55
  - data/oas-3.1/meta/base.json
54
56
  - data/oas-3.1/schema-base/2022-10-07.json
55
57
  - data/oas-3.1/schema-base/2025-02-13.json
58
+ - data/oas-3.1/schema-base/2025-09-15.json
59
+ - data/oas-3.1/schema-base/2025-09-17.json
56
60
  - data/oas-3.1/schema/2022-10-07.json
57
61
  - data/oas-3.1/schema/2025-02-13.json
62
+ - data/oas-3.1/schema/2025-09-15.json
63
+ - data/oas-3.1/schema/2025-09-17.json
58
64
  - lib/skooma.rb
59
65
  - lib/skooma/body_parsers.rb
60
66
  - lib/skooma/coverage.rb