jsonapi_schema 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -0
- data/README.md +53 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/jsonapi_schema.gemspec +44 -0
- data/lib/jsonapi_schema.rb +20 -0
- data/lib/jsonapi_schema/source/schema.json +382 -0
- data/lib/jsonapi_schema/version.rb +5 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1e4764997cca7db95becb2231f906e523f22c63ff693807230635e80b6dcff1c
|
4
|
+
data.tar.gz: 5b53fb43013e20ac83e811d8606c7957a66d5bcf8f6b6fb99d6af2446c47f329
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 814018690587ac2cdae2c5ef442d69d313abb216b87501b2871e20a12c79254881f66e130d7a64f7fd37f2dcd417a01eecd9b51c2c5226e5499a157214728c7c
|
7
|
+
data.tar.gz: ff24cd0abc7944edb3abcc1359a0e2e31644e2f0056f462c2192eb3868fe4f19d1fda61628c258ed1d1c7ae1aa94448de565efbf63845f69dd6a5609f6b8d164
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#
|
2
|
+
|
3
|
+
0.1.1
|
4
|
+
|
5
|
+
- rename to jsonapi_schema
|
6
|
+
- Add `JsonapiSchema::MEDIA_TYPE` (`"application/vnd.api+json"`)
|
7
|
+
|
8
|
+
0.1.0
|
9
|
+
|
10
|
+
- Initial release
|
11
|
+
- Include http://jsonapi.org/schema loaded at 2019-03-21T10:24:55+01:00
|
12
|
+
- One method: `JsonapiSchema::Source.schema_path` to return absolute path to the JSON Schema
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
jsonapi_schema (0.1.2)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.8.0)
|
12
|
+
rspec-core (~> 3.8.0)
|
13
|
+
rspec-expectations (~> 3.8.0)
|
14
|
+
rspec-mocks (~> 3.8.0)
|
15
|
+
rspec-core (3.8.0)
|
16
|
+
rspec-support (~> 3.8.0)
|
17
|
+
rspec-expectations (3.8.3)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.8.0)
|
20
|
+
rspec-mocks (3.8.0)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-support (3.8.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (~> 2.0)
|
30
|
+
jsonapi_schema!
|
31
|
+
rake (~> 10.0)
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
2.0.1
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# JsonapiSchema
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/ahx/jsonapi_schema.svg?branch=master)](https://travis-ci.org/ahx/jsonapi_schema)
|
4
|
+
|
5
|
+
This is the [JSON:API JSON Schema](http://jsonapi.org/schema) packaged as a rubygem.
|
6
|
+
Use this to validate a HTTP response body according to [JSON:API](http://jsonapi.org).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
group :test, :development do
|
14
|
+
gem 'jsonapi_schema'
|
15
|
+
end
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
JsonapiSchema.schema_path # returns path to the schema file, a String
|
26
|
+
|
27
|
+
JsonapiSchema::MEDIA_TYPE # alias: JsonapiSchema::CONTENT_TYPE
|
28
|
+
# => 'application/vnd.api+json'
|
29
|
+
|
30
|
+
JsonapiSchema.schema # returns the parsed object, a Hash
|
31
|
+
```
|
32
|
+
|
33
|
+
`JsonapiSchema.schema` parses the file via [multi_json](https://rubygems.org/gems/multi_json).
|
34
|
+
|
35
|
+
Validate your response using [json_schemer](http://rubygems.org/gems/json_schemer) (not part of this gem):
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
require 'json_schemer'
|
39
|
+
|
40
|
+
schemer = JSONSchemer.schema(JsonapiSchema.schema)
|
41
|
+
schemer.valid?(JSON.parse(last_response.body))
|
42
|
+
# => true/false
|
43
|
+
```
|
44
|
+
|
45
|
+
## Development
|
46
|
+
|
47
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
48
|
+
|
49
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ivx/jsonapi_schema.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'jsonapi_schema'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'jsonapi_schema/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'jsonapi_schema'
|
9
|
+
spec.version = JsonapiSchema::VERSION
|
10
|
+
spec.licenses = ['MIT']
|
11
|
+
spec.authors = ['Andreas Haller']
|
12
|
+
spec.email = ['andreas.haller@invision.de']
|
13
|
+
|
14
|
+
spec.summary = 'JSON:API JSON Schema packed in a rubygem'
|
15
|
+
spec.description = 'Use this to validate JSON:API response bodies'
|
16
|
+
spec.homepage = 'https://github.com/ivx/jsonapi_schema'
|
17
|
+
|
18
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
19
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
20
|
+
if spec.respond_to?(:metadata)
|
21
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
22
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
23
|
+
spec.metadata['changelog_uri'] = 'https://github.com/ivx/jsonapi_schema/blob/master/CHANGELOG.md'
|
24
|
+
else
|
25
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
26
|
+
'public gem pushes.'
|
27
|
+
end
|
28
|
+
|
29
|
+
# Specify which files should be added to the gem when it is released.
|
30
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
31
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
32
|
+
`git ls-files -z`
|
33
|
+
.split("\x0")
|
34
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
35
|
+
.reject { |f| %w[Dockerfile].include?(f) }
|
36
|
+
end
|
37
|
+
spec.bindir = 'exe'
|
38
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
39
|
+
spec.require_paths = ['lib']
|
40
|
+
|
41
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
42
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
43
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
44
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module JsonapiSchema
|
6
|
+
MEDIA_TYPE = CONTENT_TYPE = 'application/vnd.api+json'
|
7
|
+
|
8
|
+
SCHEMA_PATH = File.expand_path(
|
9
|
+
'./jsonapi_schema/source/schema.json',
|
10
|
+
File.dirname(__FILE__)
|
11
|
+
)
|
12
|
+
|
13
|
+
def self.schema_path
|
14
|
+
SCHEMA_PATH
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.schema
|
18
|
+
@schema ||= JSON.parse(File.read(schema_path))
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,382 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
3
|
+
"title": "JSON:API Schema",
|
4
|
+
"description": "This is a schema for responses in the JSON:API format. For more, see http://jsonapi.org",
|
5
|
+
"oneOf": [
|
6
|
+
{
|
7
|
+
"$ref": "#/definitions/success"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"$ref": "#/definitions/failure"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"$ref": "#/definitions/info"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
|
17
|
+
"definitions": {
|
18
|
+
"success": {
|
19
|
+
"type": "object",
|
20
|
+
"required": [
|
21
|
+
"data"
|
22
|
+
],
|
23
|
+
"properties": {
|
24
|
+
"data": {
|
25
|
+
"$ref": "#/definitions/data"
|
26
|
+
},
|
27
|
+
"included": {
|
28
|
+
"description": "To reduce the number of HTTP requests, servers **MAY** allow responses that include related resources along with the requested primary resources. Such responses are called \"compound documents\".",
|
29
|
+
"type": "array",
|
30
|
+
"items": {
|
31
|
+
"$ref": "#/definitions/resource"
|
32
|
+
},
|
33
|
+
"uniqueItems": true
|
34
|
+
},
|
35
|
+
"meta": {
|
36
|
+
"$ref": "#/definitions/meta"
|
37
|
+
},
|
38
|
+
"links": {
|
39
|
+
"description": "Link members related to the primary data.",
|
40
|
+
"allOf": [
|
41
|
+
{
|
42
|
+
"$ref": "#/definitions/links"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"$ref": "#/definitions/pagination"
|
46
|
+
}
|
47
|
+
]
|
48
|
+
},
|
49
|
+
"jsonapi": {
|
50
|
+
"$ref": "#/definitions/jsonapi"
|
51
|
+
}
|
52
|
+
},
|
53
|
+
"additionalProperties": false
|
54
|
+
},
|
55
|
+
"failure": {
|
56
|
+
"type": "object",
|
57
|
+
"required": [
|
58
|
+
"errors"
|
59
|
+
],
|
60
|
+
"properties": {
|
61
|
+
"errors": {
|
62
|
+
"type": "array",
|
63
|
+
"items": {
|
64
|
+
"$ref": "#/definitions/error"
|
65
|
+
},
|
66
|
+
"uniqueItems": true
|
67
|
+
},
|
68
|
+
"meta": {
|
69
|
+
"$ref": "#/definitions/meta"
|
70
|
+
},
|
71
|
+
"jsonapi": {
|
72
|
+
"$ref": "#/definitions/jsonapi"
|
73
|
+
},
|
74
|
+
"links": {
|
75
|
+
"$ref": "#/definitions/links"
|
76
|
+
}
|
77
|
+
},
|
78
|
+
"additionalProperties": false
|
79
|
+
},
|
80
|
+
"info": {
|
81
|
+
"type": "object",
|
82
|
+
"required": [
|
83
|
+
"meta"
|
84
|
+
],
|
85
|
+
"properties": {
|
86
|
+
"meta": {
|
87
|
+
"$ref": "#/definitions/meta"
|
88
|
+
},
|
89
|
+
"links": {
|
90
|
+
"$ref": "#/definitions/links"
|
91
|
+
},
|
92
|
+
"jsonapi": {
|
93
|
+
"$ref": "#/definitions/jsonapi"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
"additionalProperties": false
|
97
|
+
},
|
98
|
+
|
99
|
+
"meta": {
|
100
|
+
"description": "Non-standard meta-information that can not be represented as an attribute or relationship.",
|
101
|
+
"type": "object",
|
102
|
+
"additionalProperties": true
|
103
|
+
},
|
104
|
+
"data": {
|
105
|
+
"description": "The document's \"primary data\" is a representation of the resource or collection of resources targeted by a request.",
|
106
|
+
"oneOf": [
|
107
|
+
{
|
108
|
+
"$ref": "#/definitions/resource"
|
109
|
+
},
|
110
|
+
{
|
111
|
+
"description": "An array of resource objects, an array of resource identifier objects, or an empty array ([]), for requests that target resource collections.",
|
112
|
+
"type": "array",
|
113
|
+
"items": {
|
114
|
+
"$ref": "#/definitions/resource"
|
115
|
+
},
|
116
|
+
"uniqueItems": true
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"description": "null if the request is one that might correspond to a single resource, but doesn't currently.",
|
120
|
+
"type": "null"
|
121
|
+
}
|
122
|
+
]
|
123
|
+
},
|
124
|
+
"resource": {
|
125
|
+
"description": "\"Resource objects\" appear in a JSON:API document to represent resources.",
|
126
|
+
"type": "object",
|
127
|
+
"required": [
|
128
|
+
"type",
|
129
|
+
"id"
|
130
|
+
],
|
131
|
+
"properties": {
|
132
|
+
"type": {
|
133
|
+
"type": "string"
|
134
|
+
},
|
135
|
+
"id": {
|
136
|
+
"type": "string"
|
137
|
+
},
|
138
|
+
"attributes": {
|
139
|
+
"$ref": "#/definitions/attributes"
|
140
|
+
},
|
141
|
+
"relationships": {
|
142
|
+
"$ref": "#/definitions/relationships"
|
143
|
+
},
|
144
|
+
"links": {
|
145
|
+
"$ref": "#/definitions/links"
|
146
|
+
},
|
147
|
+
"meta": {
|
148
|
+
"$ref": "#/definitions/meta"
|
149
|
+
}
|
150
|
+
},
|
151
|
+
"additionalProperties": false
|
152
|
+
},
|
153
|
+
"relationshipLinks": {
|
154
|
+
"description": "A resource object **MAY** contain references to other resource objects (\"relationships\"). Relationships may be to-one or to-many. Relationships can be specified by including a member in a resource's links object.",
|
155
|
+
"type": "object",
|
156
|
+
"properties": {
|
157
|
+
"self": {
|
158
|
+
"description": "A `self` member, whose value is a URL for the relationship itself (a \"relationship URL\"). This URL allows the client to directly manipulate the relationship. For example, it would allow a client to remove an `author` from an `article` without deleting the people resource itself.",
|
159
|
+
"$ref": "#/definitions/link"
|
160
|
+
},
|
161
|
+
"related": {
|
162
|
+
"$ref": "#/definitions/link"
|
163
|
+
}
|
164
|
+
},
|
165
|
+
"additionalProperties": true
|
166
|
+
},
|
167
|
+
"links": {
|
168
|
+
"type": "object",
|
169
|
+
"additionalProperties": {
|
170
|
+
"$ref": "#/definitions/link"
|
171
|
+
}
|
172
|
+
},
|
173
|
+
"link": {
|
174
|
+
"description": "A link **MUST** be represented as either: a string containing the link's URL or a link object.",
|
175
|
+
"oneOf": [
|
176
|
+
{
|
177
|
+
"description": "A string containing the link's URL.",
|
178
|
+
"type": "string",
|
179
|
+
"format": "uri-reference"
|
180
|
+
},
|
181
|
+
{
|
182
|
+
"type": "object",
|
183
|
+
"required": [
|
184
|
+
"href"
|
185
|
+
],
|
186
|
+
"properties": {
|
187
|
+
"href": {
|
188
|
+
"description": "A string containing the link's URL.",
|
189
|
+
"type": "string",
|
190
|
+
"format": "uri-reference"
|
191
|
+
},
|
192
|
+
"meta": {
|
193
|
+
"$ref": "#/definitions/meta"
|
194
|
+
}
|
195
|
+
}
|
196
|
+
}
|
197
|
+
]
|
198
|
+
},
|
199
|
+
|
200
|
+
"attributes": {
|
201
|
+
"description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.",
|
202
|
+
"type": "object",
|
203
|
+
"patternProperties": {
|
204
|
+
"^(?!relationships$|links$|id$|type$)\\w[-\\w_]*$": {
|
205
|
+
"description": "Attributes may contain any valid JSON value."
|
206
|
+
}
|
207
|
+
},
|
208
|
+
"additionalProperties": false
|
209
|
+
},
|
210
|
+
|
211
|
+
"relationships": {
|
212
|
+
"description": "Members of the relationships object (\"relationships\") represent references from the resource object in which it's defined to other resource objects.",
|
213
|
+
"type": "object",
|
214
|
+
"patternProperties": {
|
215
|
+
"^(?!id$|type$)\\w[-\\w_]*$": {
|
216
|
+
"properties": {
|
217
|
+
"links": {
|
218
|
+
"$ref": "#/definitions/relationshipLinks"
|
219
|
+
},
|
220
|
+
"data": {
|
221
|
+
"description": "Member, whose value represents \"resource linkage\".",
|
222
|
+
"oneOf": [
|
223
|
+
{
|
224
|
+
"$ref": "#/definitions/relationshipToOne"
|
225
|
+
},
|
226
|
+
{
|
227
|
+
"$ref": "#/definitions/relationshipToMany"
|
228
|
+
}
|
229
|
+
]
|
230
|
+
},
|
231
|
+
"meta": {
|
232
|
+
"$ref": "#/definitions/meta"
|
233
|
+
}
|
234
|
+
},
|
235
|
+
"anyOf": [
|
236
|
+
{"required": ["data"]},
|
237
|
+
{"required": ["meta"]},
|
238
|
+
{"required": ["links"]}
|
239
|
+
],
|
240
|
+
"additionalProperties": false
|
241
|
+
}
|
242
|
+
},
|
243
|
+
"additionalProperties": false
|
244
|
+
},
|
245
|
+
"relationshipToOne": {
|
246
|
+
"description": "References to other resource objects in a to-one (\"relationship\"). Relationships can be specified by including a member in a resource's links object.",
|
247
|
+
"anyOf": [
|
248
|
+
{
|
249
|
+
"$ref": "#/definitions/empty"
|
250
|
+
},
|
251
|
+
{
|
252
|
+
"$ref": "#/definitions/linkage"
|
253
|
+
}
|
254
|
+
]
|
255
|
+
},
|
256
|
+
"relationshipToMany": {
|
257
|
+
"description": "An array of objects each containing \"type\" and \"id\" members for to-many relationships.",
|
258
|
+
"type": "array",
|
259
|
+
"items": {
|
260
|
+
"$ref": "#/definitions/linkage"
|
261
|
+
},
|
262
|
+
"uniqueItems": true
|
263
|
+
},
|
264
|
+
"empty": {
|
265
|
+
"description": "Describes an empty to-one relationship.",
|
266
|
+
"type": "null"
|
267
|
+
},
|
268
|
+
"linkage": {
|
269
|
+
"description": "The \"type\" and \"id\" to non-empty members.",
|
270
|
+
"type": "object",
|
271
|
+
"required": [
|
272
|
+
"type",
|
273
|
+
"id"
|
274
|
+
],
|
275
|
+
"properties": {
|
276
|
+
"type": {
|
277
|
+
"type": "string"
|
278
|
+
},
|
279
|
+
"id": {
|
280
|
+
"type": "string"
|
281
|
+
},
|
282
|
+
"meta": {
|
283
|
+
"$ref": "#/definitions/meta"
|
284
|
+
}
|
285
|
+
},
|
286
|
+
"additionalProperties": false
|
287
|
+
},
|
288
|
+
"pagination": {
|
289
|
+
"type": "object",
|
290
|
+
"properties": {
|
291
|
+
"first": {
|
292
|
+
"description": "The first page of data",
|
293
|
+
"oneOf": [
|
294
|
+
{ "type": "string", "format": "uri-reference" },
|
295
|
+
{ "type": "null" }
|
296
|
+
]
|
297
|
+
},
|
298
|
+
"last": {
|
299
|
+
"description": "The last page of data",
|
300
|
+
"oneOf": [
|
301
|
+
{ "type": "string", "format": "uri-reference" },
|
302
|
+
{ "type": "null" }
|
303
|
+
]
|
304
|
+
},
|
305
|
+
"prev": {
|
306
|
+
"description": "The previous page of data",
|
307
|
+
"oneOf": [
|
308
|
+
{ "type": "string", "format": "uri-reference" },
|
309
|
+
{ "type": "null" }
|
310
|
+
]
|
311
|
+
},
|
312
|
+
"next": {
|
313
|
+
"description": "The next page of data",
|
314
|
+
"oneOf": [
|
315
|
+
{ "type": "string", "format": "uri-reference" },
|
316
|
+
{ "type": "null" }
|
317
|
+
]
|
318
|
+
}
|
319
|
+
}
|
320
|
+
},
|
321
|
+
|
322
|
+
"jsonapi": {
|
323
|
+
"description": "An object describing the server's implementation",
|
324
|
+
"type": "object",
|
325
|
+
"properties": {
|
326
|
+
"version": {
|
327
|
+
"type": "string"
|
328
|
+
},
|
329
|
+
"meta": {
|
330
|
+
"$ref": "#/definitions/meta"
|
331
|
+
}
|
332
|
+
},
|
333
|
+
"additionalProperties": false
|
334
|
+
},
|
335
|
+
|
336
|
+
"error": {
|
337
|
+
"type": "object",
|
338
|
+
"properties": {
|
339
|
+
"id": {
|
340
|
+
"description": "A unique identifier for this particular occurrence of the problem.",
|
341
|
+
"type": "string"
|
342
|
+
},
|
343
|
+
"links": {
|
344
|
+
"$ref": "#/definitions/links"
|
345
|
+
},
|
346
|
+
"status": {
|
347
|
+
"description": "The HTTP status code applicable to this problem, expressed as a string value.",
|
348
|
+
"type": "string"
|
349
|
+
},
|
350
|
+
"code": {
|
351
|
+
"description": "An application-specific error code, expressed as a string value.",
|
352
|
+
"type": "string"
|
353
|
+
},
|
354
|
+
"title": {
|
355
|
+
"description": "A short, human-readable summary of the problem. It **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of localization.",
|
356
|
+
"type": "string"
|
357
|
+
},
|
358
|
+
"detail": {
|
359
|
+
"description": "A human-readable explanation specific to this occurrence of the problem.",
|
360
|
+
"type": "string"
|
361
|
+
},
|
362
|
+
"source": {
|
363
|
+
"type": "object",
|
364
|
+
"properties": {
|
365
|
+
"pointer": {
|
366
|
+
"description": "A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. \"/data\" for a primary data object, or \"/data/attributes/title\" for a specific attribute].",
|
367
|
+
"type": "string"
|
368
|
+
},
|
369
|
+
"parameter": {
|
370
|
+
"description": "A string indicating which query parameter caused the error.",
|
371
|
+
"type": "string"
|
372
|
+
}
|
373
|
+
}
|
374
|
+
},
|
375
|
+
"meta": {
|
376
|
+
"$ref": "#/definitions/meta"
|
377
|
+
}
|
378
|
+
},
|
379
|
+
"additionalProperties": false
|
380
|
+
}
|
381
|
+
}
|
382
|
+
}
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jsonapi_schema
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andreas Haller
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Use this to validate JSON:API response bodies
|
56
|
+
email:
|
57
|
+
- andreas.haller@invision.de
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- CHANGELOG.md
|
66
|
+
- Gemfile
|
67
|
+
- Gemfile.lock
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- bin/console
|
71
|
+
- bin/setup
|
72
|
+
- jsonapi_schema.gemspec
|
73
|
+
- lib/jsonapi_schema.rb
|
74
|
+
- lib/jsonapi_schema/source/schema.json
|
75
|
+
- lib/jsonapi_schema/version.rb
|
76
|
+
homepage: https://github.com/ivx/jsonapi_schema
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata:
|
80
|
+
homepage_uri: https://github.com/ivx/jsonapi_schema
|
81
|
+
source_code_uri: https://github.com/ivx/jsonapi_schema
|
82
|
+
changelog_uri: https://github.com/ivx/jsonapi_schema/blob/master/CHANGELOG.md
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
requirements: []
|
98
|
+
rubygems_version: 3.0.1
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: JSON:API JSON Schema packed in a rubygem
|
102
|
+
test_files: []
|