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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab6dec00ccfd2aef4de8cbb582ba5fb96c023effb0c00d6dfed3892b937bdeeb
4
- data.tar.gz: '0883832352a38370ded13541808dc521a5a46753efa91274b2caed39e4590757'
3
+ metadata.gz: 811f3625d6e17f8d01c93cb8d4f0457ab72cba33c2ebd5bb67dd86d38a86bfa6
4
+ data.tar.gz: 786acd0acf2501618038d0c6cf7e3bcc5dac36b475de5aea4fdf56752634a0c0
5
5
  SHA512:
6
- metadata.gz: f91bc0fa8d02977bafff8af134257599ee89d436357b33d2646c5341d7a49bddf49f3c82e893e8160bf37ea59c460921fc4a39b094c2e82fbb070fcc1a843353
7
- data.tar.gz: 5d42080689c0edc24591e239d2bc0dea081e56e9bff4e2ecbd11e1c6b74a1c55320fe0d8d757d9df3dbab17414b8c9845c1386074686842f335e0214c9a9c784
6
+ metadata.gz: a553e3e9023ee3cb1abfdbb15ff73ca5ea50cf330147cbfe6455c39e6149b48c9ecb977d096d19e08bf9378a38607260ea0982953c0d9ea4d08342160db0fd59
7
+ data.tar.gz: f184a42bd01c721a236b0fbd72b46d94f7a7a98e0963a2c1758c3dbd29bfb76ca63935f3681d594375b7a1d2cadd7e29cc257154f2078048d9a846ae7822d8de
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
 
13
13
  *.gem
14
+ Gemfile.lock
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Jsonschema::Generator
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jsonschema/generator`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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 = 'Write a short summary, because RubyGems requires one.'
14
- spec.description = 'Write a longer description or delete this line.'
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', '~> 2.0'
46
- spec.add_development_dependency 'pry', '~> 0.12'
47
- spec.add_development_dependency 'rake', '~> 10.0'
48
- spec.add_development_dependency 'rspec', '~> 3.0'
49
- spec.add_development_dependency 'rubocop', '~> 0.63'
50
- spec.add_development_dependency 'rubocop-rspec', '~> 1.31'
51
- spec.add_development_dependency 'simplecov', '~> 0.4'
52
- spec.add_development_dependency 'simplecov-console', '~> 0.4'
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jsonschema
4
4
  module Generator
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  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.0
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-02-09 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
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.12'
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.12'
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: '10.0'
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: '10.0'
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: '3.0'
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: '3.0'
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.63'
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.63'
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: '1.31'
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: '1.31'
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.4'
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.4'
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.4'
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.4'
125
- description: Write a longer description or delete this line.
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.1
171
+ rubygems_version: 3.0.3
173
172
  signing_key:
174
173
  specification_version: 4
175
- summary: Write a short summary, because RubyGems requires one.
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