jsonschema-generator 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +30 -4
- data/jsonschema-generator.gemspec +11 -11
- data/lib/jsonschema/generator/version.rb +1 -1
- metadata +38 -39
- data/Gemfile.lock +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 811f3625d6e17f8d01c93cb8d4f0457ab72cba33c2ebd5bb67dd86d38a86bfa6
|
4
|
+
data.tar.gz: 786acd0acf2501618038d0c6cf7e3bcc5dac36b475de5aea4fdf56752634a0c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a553e3e9023ee3cb1abfdbb15ff73ca5ea50cf330147cbfe6455c39e6149b48c9ecb977d096d19e08bf9378a38607260ea0982953c0d9ea4d08342160db0fd59
|
7
|
+
data.tar.gz: f184a42bd01c721a236b0fbd72b46d94f7a7a98e0963a2c1758c3dbd29bfb76ca63935f3681d594375b7a1d2cadd7e29cc257154f2078048d9a846ae7822d8de
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Jsonschema::Generator
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Generates jsonschema from json using [Draft-07](https://json-schema.org/draft-07/json-schema-release-notes.html) specification.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,35 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
```ruby
|
24
|
+
require 'jsonschema-generator'
|
25
|
+
|
26
|
+
input = {
|
27
|
+
first: 'first',
|
28
|
+
second: 2,
|
29
|
+
third: 'third',
|
30
|
+
}.to_json
|
31
|
+
|
32
|
+
Jsonschema::Generator::Draft07.new(input).call
|
33
|
+
|
34
|
+
# output
|
35
|
+
# {
|
36
|
+
# 'title' => 'Root',
|
37
|
+
# 'type' => 'object',
|
38
|
+
# 'properties' => {
|
39
|
+
# 'first' => {
|
40
|
+
# 'type' => 'string',
|
41
|
+
# },
|
42
|
+
# 'second' => {
|
43
|
+
# 'type' => 'integer',
|
44
|
+
# },
|
45
|
+
# 'third' => {
|
46
|
+
# 'type' => 'string',
|
47
|
+
# },
|
48
|
+
# },
|
49
|
+
# 'required' => %w[first second third],
|
50
|
+
# }
|
51
|
+
```
|
26
52
|
|
27
53
|
## Development
|
28
54
|
|
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['Alex Bykov']
|
11
11
|
spec.email = ['leksster@gmail.com']
|
12
12
|
|
13
|
-
spec.summary = '
|
14
|
-
spec.description = '
|
13
|
+
spec.summary = 'Generate JSON schema from JSON.'
|
14
|
+
spec.description = 'Generate JSON schema from JSON.'
|
15
15
|
spec.homepage = 'https://github.com/jsonschema-rb/jsonschema-generator'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
# to allow pushing to a single host or delete this
|
21
21
|
# section to allow pushing to any host.
|
22
22
|
if spec.respond_to?(:metadata)
|
23
|
-
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
|
24
24
|
|
25
25
|
spec.metadata['homepage_uri'] = spec.homepage
|
26
26
|
spec.metadata['source_code_uri'] = 'https://github.com/jsonschema-rb/jsonschema-generator'
|
@@ -42,12 +42,12 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
43
43
|
spec.require_paths = ['lib']
|
44
44
|
|
45
|
-
spec.add_development_dependency 'bundler'
|
46
|
-
spec.add_development_dependency 'pry'
|
47
|
-
spec.add_development_dependency 'rake'
|
48
|
-
spec.add_development_dependency 'rspec'
|
49
|
-
spec.add_development_dependency 'rubocop'
|
50
|
-
spec.add_development_dependency 'rubocop-rspec'
|
51
|
-
spec.add_development_dependency 'simplecov'
|
52
|
-
spec.add_development_dependency 'simplecov-console'
|
45
|
+
spec.add_development_dependency 'bundler'
|
46
|
+
spec.add_development_dependency 'pry'
|
47
|
+
spec.add_development_dependency 'rake'
|
48
|
+
spec.add_development_dependency 'rspec'
|
49
|
+
spec.add_development_dependency 'rubocop'
|
50
|
+
spec.add_development_dependency 'rubocop-rspec'
|
51
|
+
spec.add_development_dependency 'simplecov'
|
52
|
+
spec.add_development_dependency 'simplecov-console'
|
53
53
|
end
|
metadata
CHANGED
@@ -1,128 +1,128 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonschema-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Bykov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
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: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop-rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: simplecov
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov-console
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0
|
117
|
+
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0
|
125
|
-
description:
|
124
|
+
version: '0'
|
125
|
+
description: Generate JSON schema from JSON.
|
126
126
|
email:
|
127
127
|
- leksster@gmail.com
|
128
128
|
executables: []
|
@@ -135,7 +135,6 @@ files:
|
|
135
135
|
- ".travis.yml"
|
136
136
|
- CODE_OF_CONDUCT.md
|
137
137
|
- Gemfile
|
138
|
-
- Gemfile.lock
|
139
138
|
- LICENSE.txt
|
140
139
|
- README.md
|
141
140
|
- Rakefile
|
@@ -150,7 +149,7 @@ homepage: https://github.com/jsonschema-rb/jsonschema-generator
|
|
150
149
|
licenses:
|
151
150
|
- MIT
|
152
151
|
metadata:
|
153
|
-
allowed_push_host: https://rubygems.org
|
152
|
+
allowed_push_host: https://rubygems.org/
|
154
153
|
homepage_uri: https://github.com/jsonschema-rb/jsonschema-generator
|
155
154
|
source_code_uri: https://github.com/jsonschema-rb/jsonschema-generator
|
156
155
|
changelog_uri: https://github.com/jsonschema-rb/jsonschema-generator
|
@@ -169,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
168
|
- !ruby/object:Gem::Version
|
170
169
|
version: '0'
|
171
170
|
requirements: []
|
172
|
-
rubygems_version: 3.0.
|
171
|
+
rubygems_version: 3.0.3
|
173
172
|
signing_key:
|
174
173
|
specification_version: 4
|
175
|
-
summary:
|
174
|
+
summary: Generate JSON schema from JSON.
|
176
175
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
jsonschema-generator (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ansi (1.5.0)
|
10
|
-
ast (2.4.0)
|
11
|
-
coderay (1.1.2)
|
12
|
-
diff-lcs (1.3)
|
13
|
-
docile (1.3.1)
|
14
|
-
hirb (0.7.3)
|
15
|
-
jaro_winkler (1.5.2)
|
16
|
-
json (2.1.0)
|
17
|
-
method_source (0.9.2)
|
18
|
-
parallel (1.13.0)
|
19
|
-
parser (2.6.0.0)
|
20
|
-
ast (~> 2.4.0)
|
21
|
-
powerpack (0.1.2)
|
22
|
-
pry (0.12.2)
|
23
|
-
coderay (~> 1.1.0)
|
24
|
-
method_source (~> 0.9.0)
|
25
|
-
rainbow (3.0.0)
|
26
|
-
rake (10.5.0)
|
27
|
-
rspec (3.8.0)
|
28
|
-
rspec-core (~> 3.8.0)
|
29
|
-
rspec-expectations (~> 3.8.0)
|
30
|
-
rspec-mocks (~> 3.8.0)
|
31
|
-
rspec-core (3.8.0)
|
32
|
-
rspec-support (~> 3.8.0)
|
33
|
-
rspec-expectations (3.8.2)
|
34
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.8.0)
|
36
|
-
rspec-mocks (3.8.0)
|
37
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.8.0)
|
39
|
-
rspec-support (3.8.0)
|
40
|
-
rubocop (0.63.0)
|
41
|
-
jaro_winkler (~> 1.5.1)
|
42
|
-
parallel (~> 1.10)
|
43
|
-
parser (>= 2.5, != 2.5.1.1)
|
44
|
-
powerpack (~> 0.1)
|
45
|
-
rainbow (>= 2.2.2, < 4.0)
|
46
|
-
ruby-progressbar (~> 1.7)
|
47
|
-
unicode-display_width (~> 1.4.0)
|
48
|
-
rubocop-rspec (1.31.0)
|
49
|
-
rubocop (>= 0.60.0)
|
50
|
-
ruby-progressbar (1.10.0)
|
51
|
-
simplecov (0.16.1)
|
52
|
-
docile (~> 1.1)
|
53
|
-
json (>= 1.8, < 3)
|
54
|
-
simplecov-html (~> 0.10.0)
|
55
|
-
simplecov-console (0.4.2)
|
56
|
-
ansi
|
57
|
-
hirb
|
58
|
-
simplecov
|
59
|
-
simplecov-html (0.10.2)
|
60
|
-
unicode-display_width (1.4.1)
|
61
|
-
|
62
|
-
PLATFORMS
|
63
|
-
ruby
|
64
|
-
|
65
|
-
DEPENDENCIES
|
66
|
-
bundler (~> 2.0)
|
67
|
-
jsonschema-generator!
|
68
|
-
pry (~> 0.12)
|
69
|
-
rake (~> 10.0)
|
70
|
-
rspec (~> 3.0)
|
71
|
-
rubocop (~> 0.63)
|
72
|
-
rubocop-rspec (~> 1.31)
|
73
|
-
simplecov (~> 0.4)
|
74
|
-
simplecov-console (~> 0.4)
|
75
|
-
|
76
|
-
BUNDLED WITH
|
77
|
-
2.0.1
|