scorpio 0.6.1 → 0.6.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f20e932b016747b1bfa5a3d45711d3b06c1362894bad9496fc002420f6b4678
4
- data.tar.gz: 96aa91530d7fb3e8b58b8c8002ea83faf9d7c10c3f660279e235a8cfccdf15b2
3
+ metadata.gz: c63ccc2d793787385be12175b68b1aca1b68372ee72bae4cb78e434d931aa941
4
+ data.tar.gz: 3e9bec23f6ca7ad6905ca1fcd33ce185f1dd5741ad3a1097d0cbc82fea09fef1
5
5
  SHA512:
6
- metadata.gz: 13858da58324b2648053d7c16c78ed1d5f4f5754a348d0ad442c2dd517fd13c9a6cdbb3f1295658795d9dae1ddd7eac7399028d9a1f087909c6b95de2d6a4ded
7
- data.tar.gz: 2ed8c1fd1a150fd00fdee372bf0ff98624458826986f67f28daa76a5db428efa346615afd1e5aa9aa2d085f3841dbb1e5ad26fe843368c89e1380d9e8371a5b4
6
+ metadata.gz: c7f265f3e6f68c340a2720a1f09238cd0f95d4a1dcfa8fb225ad4afa6e211fbe715c337d37faf7d8037ab0267b142af523182cf1d7eecca4e4cd80af16956a54
7
+ data.tar.gz: 0a3601a2380269a73fde895e1a2d9c80617a2643ead58420866baa04f5d4a2bad5ce06c54b43f155283f53286b2c1bca09b527b2f7d494d9b766e9a188ae31b6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.6.2
2
+ - replace deprecated calls to JSI
3
+
1
4
  # v0.6.1
2
5
  - compatibility
3
6
  - JSI 0.7
@@ -29,7 +29,7 @@ module Scorpio
29
29
  # google does a weird thing where it defines a schema with a $ref property where a json-schema is to be used in the document (method request and response fields), instead of just setting the schema to be the json-schema schema. we'll share a module across those schema classes that really represent schemas. is this confusingly meta enough?
30
30
  module SchemaLike
31
31
  def to_openapi
32
- dup_doc = JSI::Typelike.as_json(self)
32
+ dup_doc = JSI::Util.as_json(self)
33
33
  # openapi does not want an id field on schemas
34
34
  dup_doc.delete('id')
35
35
  if dup_doc['properties'].is_a?(Hash)
@@ -56,7 +56,7 @@ module Scorpio
56
56
 
57
57
  def to_openapi_hash(options = {})
58
58
  # we will be modifying the api document (RestDescription). clone self and modify that one.
59
- ad = self.class.new(JSI::Typelike.as_json(self))
59
+ ad = self.class.new(JSI::Util.as_json(self))
60
60
  ad_methods = []
61
61
  if ad['methods']
62
62
  ad_methods += ad['methods'].map do |mn, m|
@@ -212,7 +212,7 @@ module Scorpio
212
212
  end.call(openapi)
213
213
  end
214
214
  end
215
- JSI::Typelike.as_json(openapi)
215
+ JSI::Util.as_json(openapi)
216
216
  end
217
217
  end
218
218
  end
@@ -25,8 +25,8 @@ module Scorpio
25
25
  'documents/github.com/OAI/OpenAPI-Specification/blob/oas3-schema/schemas/v3.0/schema.yaml'
26
26
  )))
27
27
 
28
- # the schema represented by Scorpio::OpenAPI::V3::Schema will describe schemas itself, so we set it
29
- # include on its schema module the jsi_schema_instance_modules that implement schema functionality.
28
+ # the schema represented by Scorpio::OpenAPI::V3::Schema will describe schemas itself.
29
+ # JSI::Schema#describes_schema! enables this to implement the functionality of schemas.
30
30
  describe_schema = [
31
31
  openapi_document_schema.definitions['Schema'],
32
32
  openapi_document_schema.definitions['SchemaReference'],
@@ -40,7 +40,7 @@ module Scorpio
40
40
  # a problem, and this way also applies when none of the anyOf match due to schema errors.)
41
41
  openapi_document_schema.definitions['Schema'].properties['additionalProperties'],
42
42
  ]
43
- describe_schema.each { |s| s.jsi_schema_instance_modules = [JSI::Schema::Draft04] }
43
+ describe_schema.each { |s| s.describes_schema!([JSI::Schema::Draft04]) }
44
44
 
45
45
  Document = openapi_document_schema.jsi_schema_module
46
46
 
@@ -118,14 +118,14 @@ module Scorpio
118
118
  'documents/swagger.io/v2/schema.json'
119
119
  ).read))
120
120
 
121
- # the schema represented by Scorpio::OpenAPI::V2::Schema will describe schemas itself, so we set it to
122
- # include on its schema module the jsi_schema_instance_modules that implement schema functionality.
121
+ # the schema represented by Scorpio::OpenAPI::V2::Schema will describe schemas itself.
122
+ # JSI::Schema#describes_schema! enables this to implement the functionality of schemas.
123
123
  describe_schema = [
124
124
  openapi_document_schema.definitions['schema'],
125
125
  # comments above on v3's definitions['Schema'].properties['additionalProperties'] apply here too
126
126
  openapi_document_schema.definitions['schema'].properties['additionalProperties'],
127
127
  ]
128
- describe_schema.each { |s| s.jsi_schema_instance_modules = [JSI::Schema::Draft04] }
128
+ describe_schema.each { |s| s.describes_schema!([JSI::Schema::Draft04]) }
129
129
 
130
130
  Document = openapi_document_schema.jsi_schema_module
131
131
 
@@ -71,7 +71,7 @@ module Scorpio
71
71
  return @body if instance_variable_defined?(:@body)
72
72
  if instance_variable_defined?(:@body_object)
73
73
  if content_type && content_type.json?
74
- JSON.pretty_generate(JSI::Typelike.as_json(body_object))
74
+ JSON.pretty_generate(JSI::Util.as_json(body_object))
75
75
  elsif content_type && content_type.form_urlencoded?
76
76
  URI.encode_www_form(body_object)
77
77
 
@@ -324,7 +324,7 @@ module Scorpio
324
324
  else
325
325
  jsi = operation.request_schema.new_jsi(o)
326
326
  end
327
- jsi.jsi_select_children_leaf_first do |node|
327
+ jsi.jsi_select_descendents_leaf_first do |node|
328
328
  # we want to specifically reject only nodes described (only) by a false schema.
329
329
  # note that for OpenAPI schemas, false is only a valid schema as a value
330
330
  # of `additionalProperties`
@@ -418,7 +418,7 @@ module Scorpio
418
418
  end
419
419
 
420
420
  def as_json(*opt)
421
- JSI::Typelike.as_json(contained_object, *opt)
421
+ JSI::Util.as_json(contained_object, *opt)
422
422
  end
423
423
 
424
424
  def inspect
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Scorpio
4
- VERSION = "0.6.1".freeze
4
+ VERSION = "0.6.2".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scorpio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsi