oas_contrib 0.2.6 → 0.2.7
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 +4 -4
- data/README.md +80 -21
- data/lib/oas_contrib/version.rb +1 -1
- data/oas_contrib.gemspec +3 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 553f429ce4827e908aff9f8336815d800efe3265804cf6435584d817c9d02126
|
4
|
+
data.tar.gz: fc0af8b12691fd09e92dfb3b7472887a2ed4c25884fc67541b48acf54c820967
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4dbba15b781c5ae99f0c1ad3b2ebb0c2e4b70f5a41d495a93a880a019f6353114ad6b42935f7888c254193da25f793220764c9e3bad9a69be9797cb3be8ff6c
|
7
|
+
data.tar.gz: 93348ec172d47a517c4b52b960616a507ba0161bfe72f8128f01d188057aeac1adef11c78737bd20c703686408bfd603c35d26a51fb67877ed24a364ed7a54b5
|
data/README.md
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
Libraries and Commands for Open API (2.0, 3.0) Specification.
|
6
6
|
|
7
|
+
* Divide OAS file.
|
8
|
+
* Merge OAS divided files.
|
9
|
+
* Preview OAS file with SaggerUI.
|
10
|
+
|
7
11
|
## Installation
|
8
12
|
|
9
13
|
Add this line to your application's Gemfile:
|
@@ -22,40 +26,95 @@ Or install it yourself as:
|
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
25
|
-
###
|
29
|
+
### sub commands
|
30
|
+
```bash
|
31
|
+
$ oas_contrib
|
32
|
+
Commands:
|
33
|
+
oas_contrib divide <spec_file> <output_dir> (<options>) # Divide the spec_file into path units and schema units.
|
34
|
+
oas_contrib help [COMMAND] # Describe available commands or one specific command
|
35
|
+
oas_contrib merge <input_dir> <spec_file> (<options>) # Merge multiple divided files into an spec_file.
|
36
|
+
oas_contrib preview <spec_file> (<options>) # Preview the spec_file using Swagger-UI official Docker image.
|
37
|
+
```
|
26
38
|
|
27
|
-
|
28
|
-
|
39
|
+
### divide command
|
40
|
+
```bash
|
41
|
+
$ oas_contrib help divide
|
42
|
+
Usage:
|
43
|
+
oas_contrib divide <spec_file> <output_dir> (<options>)
|
29
44
|
|
30
|
-
|
45
|
+
Options:
|
46
|
+
[--out-ext=OUT_EXT] # output file ext (.yml or .json)
|
47
|
+
# Default: .yml
|
31
48
|
|
32
|
-
|
33
|
-
oas_contrib divide <OpenAPI Specification file> <output_dir> (<options>...)
|
49
|
+
Divide the spec_file into path units and schema units.
|
34
50
|
```
|
35
51
|
|
36
|
-
|
37
|
-
|------------|------------------------------|----------------------------|----------|
|
38
|
-
|`--out_ext` | the extension of output file | String (`.json` or `.yml`) | `.yml` |
|
52
|
+
#### example
|
39
53
|
|
40
|
-
|
54
|
+
##### input
|
55
|
+
[v3.yml](/example/v3.yml)
|
41
56
|
|
42
|
-
|
43
|
-
|
57
|
+
##### execution
|
58
|
+
```
|
59
|
+
$ oas_contrib divide v3.yml sample
|
60
|
+
Load: v3.yml
|
61
|
+
Dist: sample/meta
|
62
|
+
Dist: sample/meta/001_openapi.yml
|
63
|
+
Dist: sample/meta/002_info.yml
|
64
|
+
Dist: sample/meta/003_servers.yml
|
65
|
+
Dist: sample/path
|
66
|
+
Dist: sample/path/001_pets.yml
|
67
|
+
Dist: sample/path/002_pets_{petId}.yml
|
68
|
+
Dist: sample/model
|
69
|
+
Dist: sample/model/001_Pet.yml
|
70
|
+
Dist: sample/model/002_Error.yml
|
71
|
+
Dist: sample/model/003_Pets.yml
|
72
|
+
complete!
|
44
73
|
```
|
45
74
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
75
|
+
##### output
|
76
|
+
```
|
77
|
+
$ tree sample/
|
78
|
+
sample/
|
79
|
+
├── meta
|
80
|
+
│ ├── 001_openapi.yml
|
81
|
+
│ ├── 002_info.yml
|
82
|
+
│ └── 003_servers.yml
|
83
|
+
├── model
|
84
|
+
│ ├── 001_Pet.yml
|
85
|
+
│ ├── 002_Error.yml
|
86
|
+
│ └── 003_Pets.yml
|
87
|
+
└── path
|
88
|
+
├── 001_pets.yml
|
89
|
+
└── 002_pets_{petId}.yml
|
90
|
+
```
|
91
|
+
[output sample dir](/example/dist/v3)
|
51
92
|
|
93
|
+
### merge command
|
52
94
|
```bash
|
53
|
-
oas_contrib
|
95
|
+
$ oas_contrib help merge
|
96
|
+
Usage:
|
97
|
+
oas_contrib merge <input_dir> <spec_file> (<options>)
|
98
|
+
|
99
|
+
Options:
|
100
|
+
[--in-ext=IN_EXT] # input file ext (.yml or .json)
|
101
|
+
# Default: .yml
|
102
|
+
|
103
|
+
Merge multiple divided files into an spec_file.
|
54
104
|
```
|
55
105
|
|
56
|
-
|
57
|
-
|
58
|
-
|
106
|
+
### preview command
|
107
|
+
```bash
|
108
|
+
$ oas_contrib help preview
|
109
|
+
Usage:
|
110
|
+
oas_contrib preview <spec_file> (<options>)
|
111
|
+
|
112
|
+
Options:
|
113
|
+
[--port=N] # Swagger UI listen port
|
114
|
+
# Default: 50010
|
115
|
+
|
116
|
+
Preview the spec_file using Swagger-UI official Docker image.
|
117
|
+
```
|
59
118
|
|
60
119
|
## Contributing
|
61
120
|
|
data/lib/oas_contrib/version.rb
CHANGED
data/oas_contrib.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.version = OasContrib::VERSION
|
8
8
|
spec.authors = ['Michinao Shimizu']
|
9
9
|
spec.email = ['shimizu.michinao@gmail.com']
|
10
|
-
spec.summary = 'Libraries and Commands for Open API (2.
|
11
|
-
spec.description = '
|
10
|
+
spec.summary = 'Libraries and Commands for Open API (2.X, 3.X) Specification.'
|
11
|
+
spec.description = 'Divide OAS file (2.X, 3.X). Merge divided files to a OAS file. Preview OAS file with SwaggerUI Docker Container.'
|
12
12
|
spec.homepage = 'https://github.com/MichinaoShimizu/oas_contrib'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.add_dependency 'thor', '~> 0.20'
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1
|
21
|
+
spec.add_development_dependency 'bundler', '~> 2.0.1'
|
22
22
|
spec.add_development_dependency 'rake', '~> 10.0'
|
23
23
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oas_contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michinao Shimizu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.0.1
|
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:
|
40
|
+
version: 2.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,8 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
-
description:
|
69
|
+
description: Divide OAS file (2.X, 3.X). Merge divided files to a OAS file. Preview
|
70
|
+
OAS file with SwaggerUI Docker Container.
|
70
71
|
email:
|
71
72
|
- shimizu.michinao@gmail.com
|
72
73
|
executables:
|
@@ -139,9 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
140
|
- !ruby/object:Gem::Version
|
140
141
|
version: '0'
|
141
142
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.7.7
|
143
|
+
rubygems_version: 3.0.3
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
|
-
summary: Libraries and Commands for Open API (2.
|
146
|
+
summary: Libraries and Commands for Open API (2.X, 3.X) Specification.
|
147
147
|
test_files: []
|