fidor_schema 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 8010f4556647ee305be57409bf1fa3e1657a5b0f
4
- data.tar.gz: f29ca5ee5f9f667055bd07978b301f94d769d14b
3
+ metadata.gz: e53e1cb700788614951775dd07273b6496ace6b3
4
+ data.tar.gz: 1548f937b042946022184a2f9438ff13a870bd0f
5
5
  SHA512:
6
- metadata.gz: 4b4389926418b3648ff0456785adc6565719f8d3c5f3ea8b1d81bdaec8010e5a33ab38205467f3ce6c539459c92110d8a371138738aaaf41ddf7e9a5d987de0c
7
- data.tar.gz: 83a77722ad9bbd9bff3f3aa8f8c702984e63dacb667a872827ba3a798c7dfa76330a6062fdf302a6c5d10535b743ceb646f68586d918dba458ed35423434ab0f
6
+ metadata.gz: 73d91bb4748d0aa1d1798e23c535adaeb51ef5bf9cac25e72a8c713cc5c737951064cfb21d651faf768d98b68a332baa1fc07f200ef44079122aea5e167421ce
7
+ data.tar.gz: 2c55c8d184292c7fba3c815a89a0de813f10d25b90b643e5a6ccc407cf9cfc92f485cfee6e7bb50a094d71127e53b3a0e1427c31396372610a25e42d52135e46
data/fidor_schema.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.5'
22
22
  spec.add_development_dependency 'rspec'
23
23
  spec.add_development_dependency 'activesupport'
24
- spec.add_development_dependency 'json_schema_tools', '>=0.3.0'
24
+ spec.add_development_dependency 'json_schema_tools', '>=0.3.3'
25
25
  spec.add_development_dependency 'activemodel' # required by above
26
26
  spec.add_development_dependency 'rake'
27
27
 
@@ -1,5 +1,5 @@
1
1
  module Fidor
2
2
  class Schema
3
- VERSION='0.3.0'
3
+ VERSION='0.3.1'
4
4
  end
5
5
  end
@@ -88,10 +88,7 @@
88
88
  },
89
89
  {
90
90
  "rel" : "instances",
91
- "href" : "accounts",
92
- "targetSchema" : {
93
- "$ref" : "./lists/accounts.json#"
94
- }
91
+ "href" : "accounts"
95
92
  },
96
93
  {
97
94
  "rel" : "transactions",
@@ -102,24 +99,15 @@
102
99
  },
103
100
  {
104
101
  "rel" : "internal_transfers",
105
- "href" : "accounts/{id}/internal_transfers",
106
- "targetSchema" : {
107
- "$ref" : "./lists/internal_transfers.json#"
108
- }
102
+ "href" : "accounts/{id}/internal_transfers"
109
103
  },
110
104
  {
111
105
  "rel" : "sepa_credit_transfers",
112
- "href" : "accounts/{id}/sepa_credit_transfers",
113
- "targetSchema" : {
114
- "$ref" : "./lists/sepa_credit_transfers.json#"
115
- }
106
+ "href" : "accounts/{id}/sepa_credit_transfers"
116
107
  },
117
108
  {
118
109
  "rel" : "sepa_direct_debits",
119
- "href" : "accounts/{id}/sepa_direct_debits",
120
- "targetSchema" : {
121
- "$ref" : "./lists/sepa_direct_debits.json#"
122
- }
110
+ "href" : "accounts/{id}/sepa_direct_debits"
123
111
  }
124
112
  ]
125
113
  }
@@ -194,17 +194,11 @@
194
194
  },
195
195
  {
196
196
  "rel" : "instances",
197
- "href" : "customers",
198
- "targetSchema" : {
199
- "$ref" : "./lists/customers.json#"
200
- }
197
+ "href" : "customers"
201
198
  },
202
199
  {
203
200
  "rel" : "accounts",
204
- "href" : "customers/{id}/accounts",
205
- "targetSchema" : {
206
- "$ref" : "./lists/accounts.json#"
207
- }
201
+ "href" : "customers/{id}/accounts"
208
202
  }
209
203
  ]
210
204
  }
@@ -130,9 +130,6 @@
130
130
  "description" : "Sort the results in ASC or DESC",
131
131
  "type" : "string"
132
132
  }
133
- },
134
- "targetSchema" : {
135
- "$ref" : "./lists/internal_transfers.json#"
136
133
  }
137
134
  },
138
135
  {
@@ -7,7 +7,10 @@
7
7
  "accounts" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../account.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../account.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "type" : "object",
3
- "title" : "Batch Direct Debits",
3
+ "title" : "Batch_direct_debits",
4
4
  "name" : "batch_direct_debits",
5
- "description" : "A paginated list of Batch Direct Debit objects",
5
+ "description" : "A paginated list of Batch_direct_debit objects",
6
6
  "properties" : {
7
7
  "batch_direct_debits" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../batch_direct_debit.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../batch_direct_debit.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "type" : "object",
3
- "title" : "Batch Transfers",
3
+ "title" : "Batch_transfers",
4
4
  "name" : "batch_transfers",
5
- "description" : "A paginated list of Batch Transfer objects",
5
+ "description" : "A paginated list of Batch_transfer objects",
6
6
  "properties" : {
7
7
  "batch_transfers" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../batch_transfer.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../batch_transfer.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -7,7 +7,10 @@
7
7
  "customers" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../customer.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../customer.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "type" : "object",
3
- "title" : "Internal Transfers",
3
+ "title" : "Internal_transfers",
4
4
  "name" : "internal_transfers",
5
- "description" : "A paginated list of Internal Transfer objects",
5
+ "description" : "A paginated list of Internal_transfer objects",
6
6
  "properties" : {
7
7
  "internal_transfers" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../internal_transfer.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../internal_transfer.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "type" : "object",
3
- "title" : "Sepa Credit Transfers",
3
+ "title" : "Sepa_credit_transfers",
4
4
  "name" : "sepa_credit_transfers",
5
- "description" : "A paginated list of Sepa Credit Transfer objects",
5
+ "description" : "A paginated list of Sepa_credit_transfer objects",
6
6
  "properties" : {
7
7
  "sepa_credit_transfers" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../sepa_credit_transfer.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../sepa_credit_transfer.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "type" : "object",
3
- "title" : "Sepa Direct Debits",
3
+ "title" : "Sepa_direct_debits",
4
4
  "name" : "sepa_direct_debits",
5
- "description" : "A paginated list of Sepa Direct Debit objects",
5
+ "description" : "A paginated list of Sepa_direct_debit objects",
6
6
  "properties" : {
7
7
  "sepa_direct_debits" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../sepa_direct_debit.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../sepa_direct_debit.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "type" : "object",
3
- "title" : "Sepa Mandates",
3
+ "title" : "Sepa_mandates",
4
4
  "name" : "sepa_mandates",
5
- "description" : "A paginated list of Sepa Mandate objects",
5
+ "description" : "A paginated list of Sepa_mandate objects",
6
6
  "properties" : {
7
7
  "sepa_mandates" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../sepa_mandate.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../sepa_mandate.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -7,7 +7,10 @@
7
7
  "transactions" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../transaction.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../transaction.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -7,7 +7,10 @@
7
7
  "users" : {
8
8
  "type" : "array",
9
9
  "items" : {
10
- "$ref" : "../user.json#"
10
+ "type" : "object",
11
+ "properties" : {
12
+ "$ref" : "../user.json#properties"
13
+ }
11
14
  }
12
15
  },
13
16
  "links" : {},
@@ -16,3 +19,4 @@
16
19
  }
17
20
  }
18
21
  }
22
+
@@ -116,9 +116,6 @@
116
116
  "description" : "Sort the results in ASC or DESC",
117
117
  "type" : "string"
118
118
  }
119
- },
120
- "targetSchema" : {
121
- "$ref" : "./lists/sepa_credit_transfers.json#"
122
119
  }
123
120
  },
124
121
  {
@@ -118,9 +118,6 @@
118
118
  "description" : "Sort the results in ASC or DESC",
119
119
  "type" : "string"
120
120
  }
121
- },
122
- "targetSchema" : {
123
- "$ref" : "./lists/sepa_direct_debits.json#"
124
121
  }
125
122
  },
126
123
  {
@@ -147,9 +147,6 @@
147
147
  "description" : "Sort the results in ASC or DESC",
148
148
  "type" : "string"
149
149
  }
150
- },
151
- "targetSchema" : {
152
- "$ref" : "./lists/sepa_mandates.json#"
153
150
  }
154
151
  },
155
152
  {
@@ -131,9 +131,6 @@
131
131
  ],
132
132
  "description" : "Sort the results in ASC or DESC",
133
133
  "type" : "string"
134
- },
135
- "targetSchema" : {
136
- "$ref" : "./lists/transactions.json#"
137
134
  }
138
135
  }
139
136
  }
@@ -17,4 +17,25 @@ describe Fidor::Schema do
17
17
  end
18
18
 
19
19
  end
20
+
21
+ context 'resolves $refs' do
22
+
23
+ it 'in single schema' do
24
+ SchemaTools.schema_path = Fidor::Schema.path
25
+ schema = SchemaTools::Reader.read('accounts').to_h
26
+ expect(schema['properties']['accounts']['items']['properties']['id']['type']).to eq 'string'
27
+
28
+ end
29
+
30
+ it 'should resolve all' do
31
+ SchemaTools.schema_path = Fidor::Schema.path
32
+ SchemaTools::Reader.read_all
33
+ out = []
34
+ SchemaTools::Reader.registry.each{|n, i|
35
+ out << "#{i.to_h}"
36
+ }
37
+ expect(out).to_not include('$ref')
38
+ end
39
+
40
+ end
20
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fidor_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Leciejewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.3.0
61
+ version: 0.3.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.3.0
68
+ version: 0.3.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activemodel
71
71
  requirement: !ruby/object:Gem::Requirement