json-schema-oas 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 579b9519310fca8f47113f9f5cbcdf483bc5f6993205a272e15374218555ae58
4
+ data.tar.gz: fb830c6f802bdb8e2b2ecb08b40e502f847ba97aeaa26dc9075a5d02a12ec3da
5
+ SHA512:
6
+ metadata.gz: 4fcdea8d06c0559056f606059a1bf6522feda90cd2cb42845c4e934c4a7c1dd98fd548e46eef63df75e26afe5cdc4c78cb0991437a10d4bc7be51093e609e1a3
7
+ data.tar.gz: 5b06ea1579644c0f2f875aa7d1787923deb7a5e546c6f05d6f9ed5239858e144047d032ef49f7c98feccddc45fef8003d4855e3f2113f4c3b5f2cd79f7db63e7
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,16 @@
1
+ Metrics/BlockLength:
2
+ Exclude:
3
+ - spec/**/*_spec.rb
4
+ Metrics/LineLength:
5
+ Max: 130
6
+ Metrics/MethodLength:
7
+ Max: 30
8
+ Layout/DotPosition:
9
+ EnforcedStyle: trailing
10
+ Layout/SpaceInsideHashLiteralBraces:
11
+ EnforcedStyle: no_space
12
+ Lint/Void:
13
+ Enabled: false
14
+ Naming/FileName:
15
+ Exclude:
16
+ - lib/json-schema-oas.rb
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.1
5
+ before_install: gem install bundler -v 1.16.2
6
+ script:
7
+ - "bundle exec rubocop"
8
+ - "bundle exec rspec"
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in json-schema-oas.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ json-schema-oas (0.1.0)
5
+ json-schema (~> 2.8, >= 2.8.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.6.0)
11
+ public_suffix (>= 2.0.2, < 4.0)
12
+ ast (2.4.0)
13
+ diff-lcs (1.3)
14
+ docile (1.3.1)
15
+ jaro_winkler (1.5.2)
16
+ json (2.2.0)
17
+ json-schema (2.8.1)
18
+ addressable (>= 2.4)
19
+ parallel (1.14.0)
20
+ parser (2.6.2.0)
21
+ ast (~> 2.4.0)
22
+ psych (3.1.0)
23
+ public_suffix (3.0.3)
24
+ rainbow (3.0.0)
25
+ rake (10.5.0)
26
+ rspec (3.8.0)
27
+ rspec-core (~> 3.8.0)
28
+ rspec-expectations (~> 3.8.0)
29
+ rspec-mocks (~> 3.8.0)
30
+ rspec-core (3.8.0)
31
+ rspec-support (~> 3.8.0)
32
+ rspec-expectations (3.8.2)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.8.0)
35
+ rspec-mocks (3.8.0)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.8.0)
38
+ rspec-support (3.8.0)
39
+ rubocop (0.66.0)
40
+ jaro_winkler (~> 1.5.1)
41
+ parallel (~> 1.10)
42
+ parser (>= 2.5, != 2.5.1.1)
43
+ psych (>= 3.1.0)
44
+ rainbow (>= 2.2.2, < 4.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (>= 1.4.0, < 1.6)
47
+ ruby-progressbar (1.10.0)
48
+ simplecov (0.16.1)
49
+ docile (~> 1.1)
50
+ json (>= 1.8, < 3)
51
+ simplecov-html (~> 0.10.0)
52
+ simplecov-html (0.10.2)
53
+ unicode-display_width (1.5.0)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ bundler (~> 1.16)
60
+ json-schema-oas!
61
+ rake (~> 10.0)
62
+ rspec (~> 3.0)
63
+ rubocop (~> 0.65)
64
+ simplecov (~> 0.16)
65
+
66
+ BUNDLED WITH
67
+ 1.16.2
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Json::Schema::Oas
2
+
3
+ TODO
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'json-schema-oas'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install json-schema-oas
20
+
21
+ ## Usage
22
+
23
+ TODO
24
+
25
+ ## Development
26
+
27
+ 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.
28
+
29
+ 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).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Deuteu/json-schema-oas.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'json-schema-oas'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,4 @@
1
+ {
2
+ "code": 1,
3
+ "message": "Error has occurred"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "code": "text",
3
+ "message": "Error has occurred"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "id": 1,
3
+ "tag": "tag"
4
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "id": 1,
3
+ "name": "name",
4
+ "tag": "tag"
5
+ }
File without changes
@@ -0,0 +1,100 @@
1
+ info:
2
+ version: 1.0.0
3
+ title: Swagger Petstore
4
+ license:
5
+ name: MIT
6
+ host: petstore.swagger.io
7
+ basePath: /v1
8
+ schemes:
9
+ - http
10
+ consumes:
11
+ - application/json
12
+ produces:
13
+ - application/json
14
+ paths:
15
+ /pets:
16
+ get:
17
+ summary: List all pets
18
+ operationId: listPets
19
+ tags:
20
+ - pets
21
+ parameters:
22
+ - name: limit
23
+ in: query
24
+ description: How many items to return at one time (max 100)
25
+ required: false
26
+ type: integer
27
+ format: int32
28
+ responses:
29
+ "200":
30
+ description: A paged array of pets
31
+ headers:
32
+ x-next:
33
+ type: string
34
+ description: A link to the next page of responses
35
+ schema:
36
+ $ref: '#/definitions/Pets'
37
+ default:
38
+ description: unexpected error
39
+ schema:
40
+ $ref: '#/definitions/Error'
41
+ post:
42
+ summary: Create a pet
43
+ operationId: createPets
44
+ tags:
45
+ - pets
46
+ responses:
47
+ "201":
48
+ description: Null response
49
+ default:
50
+ description: unexpected error
51
+ schema:
52
+ $ref: '#/definitions/Error'
53
+ /pets/{petId}:
54
+ get:
55
+ summary: Info for a specific pet
56
+ operationId: showPetById
57
+ tags:
58
+ - pets
59
+ parameters:
60
+ - name: petId
61
+ in: path
62
+ required: true
63
+ description: The id of the pet to retrieve
64
+ type: string
65
+ responses:
66
+ "200":
67
+ description: Expected response to a valid request
68
+ schema:
69
+ $ref: '#/definitions/Pets'
70
+ default:
71
+ description: unexpected error
72
+ schema:
73
+ $ref: '#/definitions/Error'
74
+ definitions:
75
+ Pet:
76
+ required:
77
+ - id
78
+ - name
79
+ properties:
80
+ id:
81
+ type: integer
82
+ format: int64
83
+ name:
84
+ type: string
85
+ tag:
86
+ type: string
87
+ Pets:
88
+ type: array
89
+ items:
90
+ $ref: '#/definitions/Pet'
91
+ Error:
92
+ required:
93
+ - code
94
+ - message
95
+ properties:
96
+ code:
97
+ type: integer
98
+ format: int32
99
+ message:
100
+ type: string
@@ -0,0 +1,108 @@
1
+ info:
2
+ version: 1.0.0
3
+ title: Swagger Petstore
4
+ license:
5
+ name: MIT
6
+ servers:
7
+ - url: http://petstore.swagger.io/v1
8
+ paths:
9
+ /pets:
10
+ get:
11
+ summary: List all pets
12
+ operationId: listPets
13
+ tags:
14
+ - pets
15
+ parameters:
16
+ - name: limit
17
+ in: query
18
+ description: How many items to return at one time (max 100)
19
+ required: false
20
+ schema:
21
+ type: integer
22
+ format: int32
23
+ responses:
24
+ '200':
25
+ description: A paged array of pets
26
+ headers:
27
+ x-next:
28
+ description: A link to the next page of responses
29
+ schema:
30
+ type: string
31
+ content:
32
+ application/json:
33
+ schema:
34
+ $ref: "#/components/schemas/Pets"
35
+ default:
36
+ description: unexpected error
37
+ content:
38
+ application/json:
39
+ schema:
40
+ $ref: "#/components/schemas/Error"
41
+ post:
42
+ summary: Create a pet
43
+ operationId: createPets
44
+ tags:
45
+ - pets
46
+ responses:
47
+ '201':
48
+ description: Null response
49
+ default:
50
+ description: unexpected error
51
+ content:
52
+ application/json:
53
+ schema:
54
+ $ref: "#/components/schemas/Error"
55
+ /pets/{petId}:
56
+ get:
57
+ summary: Info for a specific pet
58
+ operationId: showPetById
59
+ tags:
60
+ - pets
61
+ parameters:
62
+ - name: petId
63
+ in: path
64
+ required: true
65
+ description: The id of the pet to retrieve
66
+ schema:
67
+ type: string
68
+ responses:
69
+ '200':
70
+ description: Expected response to a valid request
71
+ content:
72
+ application/json:
73
+ schema:
74
+ $ref: "#/components/schemas/Pets"
75
+ default:
76
+ description: unexpected error
77
+ content:
78
+ application/json:
79
+ schema:
80
+ $ref: "#/components/schemas/Error"
81
+ components:
82
+ schemas:
83
+ Pet:
84
+ required:
85
+ - id
86
+ - name
87
+ properties:
88
+ id:
89
+ type: integer
90
+ format: int64
91
+ name:
92
+ type: string
93
+ tag:
94
+ type: string
95
+ Pets:
96
+ type: array
97
+ items:
98
+ $ref: "#/components/schemas/Pet"
99
+ Error:
100
+ required:
101
+ - code
102
+ - message
103
+ properties:
104
+ code:
105
+ type: integer
106
+ format: int32
107
+ message:
108
+ type: string
@@ -0,0 +1,101 @@
1
+ swagger: "2.0"
2
+ info:
3
+ version: 1.0.0
4
+ title: Swagger Petstore
5
+ license:
6
+ name: MIT
7
+ host: petstore.swagger.io
8
+ basePath: /v1
9
+ schemes:
10
+ - http
11
+ consumes:
12
+ - application/json
13
+ produces:
14
+ - application/json
15
+ paths:
16
+ /pets:
17
+ get:
18
+ summary: List all pets
19
+ operationId: listPets
20
+ tags:
21
+ - pets
22
+ parameters:
23
+ - name: limit
24
+ in: query
25
+ description: How many items to return at one time (max 100)
26
+ required: false
27
+ type: integer
28
+ format: int32
29
+ responses:
30
+ "200":
31
+ description: A paged array of pets
32
+ headers:
33
+ x-next:
34
+ type: string
35
+ description: A link to the next page of responses
36
+ schema:
37
+ $ref: '#/definitions/Pets'
38
+ default:
39
+ description: unexpected error
40
+ schema:
41
+ $ref: '#/definitions/Error'
42
+ post:
43
+ summary: Create a pet
44
+ operationId: createPets
45
+ tags:
46
+ - pets
47
+ responses:
48
+ "201":
49
+ description: Null response
50
+ default:
51
+ description: unexpected error
52
+ schema:
53
+ $ref: '#/definitions/Error'
54
+ /pets/{petId}:
55
+ get:
56
+ summary: Info for a specific pet
57
+ operationId: showPetById
58
+ tags:
59
+ - pets
60
+ parameters:
61
+ - name: petId
62
+ in: path
63
+ required: true
64
+ description: The id of the pet to retrieve
65
+ type: string
66
+ responses:
67
+ "200":
68
+ description: Expected response to a valid request
69
+ schema:
70
+ $ref: '#/definitions/Pet'
71
+ default:
72
+ description: unexpected error
73
+ schema:
74
+ $ref: '#/definitions/Error'
75
+ definitions:
76
+ Pet:
77
+ required:
78
+ - id
79
+ - name
80
+ properties:
81
+ id:
82
+ type: integer
83
+ format: int64
84
+ name:
85
+ type: string
86
+ tag:
87
+ type: string
88
+ Pets:
89
+ type: array
90
+ items:
91
+ $ref: '#/definitions/Pet'
92
+ Error:
93
+ required:
94
+ - code
95
+ - message
96
+ properties:
97
+ code:
98
+ type: integer
99
+ format: int32
100
+ message:
101
+ type: string