r2-oas 0.1.3 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/GEMSPEC.md +20 -0
- data/README.ja.md +63 -2
- data/README.md +62 -2
- data/lib/r2-oas.rb +3 -4
- data/lib/r2-oas/app_configuration.rb +1 -1
- data/lib/r2-oas/deploy/client.rb +33 -6
- data/lib/r2-oas/errors.rb +1 -0
- data/lib/r2-oas/lib/core_ext/hash/deep_merge.rb +44 -0
- data/lib/r2-oas/lib/core_ext/object/blank.rb +135 -0
- data/lib/r2-oas/lib/three-way-merge/twm.rb +83 -0
- data/lib/r2-oas/schema/builder.rb +23 -0
- data/lib/r2-oas/schema/editor.rb +13 -2
- data/lib/r2-oas/schema/generator.rb +1 -1
- data/lib/r2-oas/schema/manager/file_manager.rb +26 -0
- data/lib/r2-oas/schema/ui.rb +0 -1
- data/lib/r2-oas/schema/v3/analyzer/base_analyzer.rb +1 -6
- data/lib/r2-oas/schema/v3/builder.rb +28 -0
- data/lib/r2-oas/schema/v3/builder/base_builder.rb +60 -0
- data/lib/r2-oas/schema/v3/builder/doc_builder.rb +43 -0
- data/lib/r2-oas/schema/v3/generator.rb +1 -5
- data/lib/r2-oas/schema/v3/generator/base_generator.rb +30 -1
- data/lib/r2-oas/schema/v3/generator/components/object_generator.rb +6 -25
- data/lib/r2-oas/schema/v3/generator/components/request_body_generator.rb +6 -6
- data/lib/r2-oas/schema/v3/generator/doc_generator.rb +84 -19
- data/lib/r2-oas/schema/v3/generator/path_generator.rb +7 -19
- data/lib/r2-oas/schema/v3/generator/schema_generator.rb +5 -25
- data/lib/r2-oas/schema/v3/manager/file/base_file_manager.rb +3 -4
- data/lib/r2-oas/schema/v3/manager/pathname_manager.rb +6 -1
- data/lib/r2-oas/store.rb +118 -0
- data/lib/r2-oas/task_logging.rb +6 -4
- data/lib/r2-oas/tasks/common.rake +0 -1
- data/lib/r2-oas/tasks/main.rake +66 -73
- data/lib/r2-oas/tasks/tool.rake +32 -28
- data/lib/r2-oas/version.rb +1 -1
- metadata +85 -69
- data/.github/ISSUE_TEMPLATE.md +0 -12
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -12
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/.rubocop.yml +0 -7
- data/.rubocop_todo.yml +0 -228
- data/.travis.yml +0 -22
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -12
- data/Gemfile.lock +0 -222
- data/Rakefile +0 -8
- data/bin/console +0 -12
- data/bin/setup +0 -8
- data/docs/.nojekyll +0 -0
- data/docs/README.md +0 -173
- data/docs/_sidebar.md +0 -23
- data/docs/attention/if_clash.md +0 -19
- data/docs/index.html +0 -28
- data/docs/schema/3.0.0.md +0 -155
- data/docs/setting/COC.md +0 -14
- data/docs/setting/CORS.md +0 -22
- data/docs/setting/configure.md +0 -163
- data/docs/usage/analyze_docs.md +0 -875
- data/docs/usage/clean_docs.md +0 -19
- data/docs/usage/deploy_docs.md +0 -839
- data/docs/usage/display_paths_list.md +0 -35
- data/docs/usage/display_paths_stats.md +0 -54
- data/docs/usage/edit_docs.md +0 -218
- data/docs/usage/generate_docs.md +0 -256
- data/docs/usage/monitor_docs.md +0 -219
- data/docs/usage/use_hook_methods.md +0 -236
- data/docs/usage/use_hook_to_generate_docs.md +0 -235
- data/docs/usage/use_schema_namespace.md +0 -183
- data/docs/usage/use_tag_namespace.md +0 -182
- data/docs/usage/view_docs.md +0 -262
- data/lib/r2-oas/deploy/swagger-ui/dist/favicon-16x16.png +0 -0
- data/lib/r2-oas/deploy/swagger-ui/dist/favicon-32x32.png +0 -0
- data/lib/r2-oas/deploy/swagger-ui/dist/oauth2-redirect.html +0 -68
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js +0 -134
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js.map +0 -1
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js +0 -22
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js.map +0 -1
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css +0 -4
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css.map +0 -1
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js +0 -9
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js.map +0 -1
- data/r2-oas.gemspec +0 -42
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'key_flatten'
|
4
|
+
|
5
|
+
# rubocop:disable all
|
6
|
+
module Twm
|
7
|
+
class << self
|
8
|
+
#
|
9
|
+
# orig: local docs
|
10
|
+
# left: generate docs
|
11
|
+
# right: local src files
|
12
|
+
#
|
13
|
+
# condition: merge right into left
|
14
|
+
def yaml_merge(left, orig, right)
|
15
|
+
flat_orig = KeyFlatten.key_flatten(orig || {}).to_h
|
16
|
+
flat_left = KeyFlatten.key_flatten(left || {}).to_h
|
17
|
+
flat_right = KeyFlatten.key_flatten(right || {}).to_h
|
18
|
+
|
19
|
+
all_keys = (flat_left.keys + flat_orig.keys + flat_right.keys).uniq
|
20
|
+
|
21
|
+
twm = all_keys.each_with_object({}) do |key, result|
|
22
|
+
r = three_equal?(flat_left[key], flat_orig[key], flat_right[key])
|
23
|
+
|
24
|
+
if r[:left_orig] && r[:orig_right] && r[:left_right]
|
25
|
+
# no change
|
26
|
+
result[key] = flat_orig[key]
|
27
|
+
elsif r[:left_orig] && !r[:orig_right] && !r[:left_right]
|
28
|
+
# edited
|
29
|
+
result[key] = flat_right[key]
|
30
|
+
elsif !r[:left_orig] && r[:orig_right] && !r[:left_right]
|
31
|
+
# generate
|
32
|
+
result[key] = flat_left[key]
|
33
|
+
elsif !r[:left_orig] && !r[:orig_right] && r[:left_right]
|
34
|
+
# edited
|
35
|
+
result[key] = flat_right[key]
|
36
|
+
elsif !r[:left_orig] && !r[:orig_right] && !r[:left_right]
|
37
|
+
# conflict => prioritize edited
|
38
|
+
result[key] = flat_right[key]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
twm = twm.delete_if { |_k, v| v.nil? }
|
43
|
+
KeyFlatten.key_unflatten(twm)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def three_equal?(left, orig, right)
|
49
|
+
if left == orig && orig == right
|
50
|
+
{
|
51
|
+
left_orig: true,
|
52
|
+
orig_right: true,
|
53
|
+
left_right: true
|
54
|
+
}
|
55
|
+
elsif left == orig && orig != right
|
56
|
+
{
|
57
|
+
left_orig: true,
|
58
|
+
orig_right: false,
|
59
|
+
left_right: false
|
60
|
+
}
|
61
|
+
elsif left != orig && orig == right
|
62
|
+
{
|
63
|
+
left_orig: false,
|
64
|
+
orig_right: true,
|
65
|
+
left_right: false
|
66
|
+
}
|
67
|
+
elsif left != orig && orig != right && left == right
|
68
|
+
{
|
69
|
+
left_orig: false,
|
70
|
+
orig_right: false,
|
71
|
+
left_right: true
|
72
|
+
}
|
73
|
+
elsif left != orig && orig != right && left != right
|
74
|
+
{
|
75
|
+
left_orig: false,
|
76
|
+
orig_right: false,
|
77
|
+
left_right: false
|
78
|
+
}
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
# rubocop:enable all
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'forwardable'
|
4
|
+
require 'r2-oas/schema/v3/builder'
|
5
|
+
|
6
|
+
module R2OAS
|
7
|
+
module Schema
|
8
|
+
class Builder
|
9
|
+
extend Forwardable
|
10
|
+
|
11
|
+
def_delegators :@builder, :build_docs, :oas_doc
|
12
|
+
|
13
|
+
def initialize(options = {})
|
14
|
+
case ::R2OAS.version
|
15
|
+
when :v3
|
16
|
+
@builder = V3::Builder.new(options)
|
17
|
+
else
|
18
|
+
raise NoImplementError, "Do not support version: #{::R2OAS.version}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/r2-oas/schema/editor.rb
CHANGED
@@ -5,7 +5,6 @@ require 'eventmachine'
|
|
5
5
|
require 'watir'
|
6
6
|
require 'tempfile'
|
7
7
|
require 'fileutils'
|
8
|
-
require 'shell'
|
9
8
|
require 'forwardable'
|
10
9
|
|
11
10
|
# Can't use ActiveSupport::Autroload
|
@@ -73,6 +72,10 @@ module R2OAS
|
|
73
72
|
analyzer.analyze_docs
|
74
73
|
end
|
75
74
|
|
75
|
+
# MEMO
|
76
|
+
# TargetRubyVersion is 2.7 and there is a warning
|
77
|
+
# Because it is necessary to support from ruby2.3 series where begin cannot be omitted
|
78
|
+
# rubocop:disable Style/RedundantBegin
|
76
79
|
def ensure_save_tmp_schema_file
|
77
80
|
EM.add_periodic_timer(interval_to_save_edited_tmp_schema) do
|
78
81
|
m = Mutex.new
|
@@ -90,6 +93,7 @@ module R2OAS
|
|
90
93
|
end
|
91
94
|
end
|
92
95
|
end
|
96
|
+
# rubocop:enable Style/RedundantBegin
|
93
97
|
|
94
98
|
def save_after_fetch_local_strage
|
95
99
|
@after_schema_data = @browser.driver.local_storage[storage_key] || @after_schema_data
|
@@ -110,7 +114,14 @@ module R2OAS
|
|
110
114
|
@browser ||= Watir::Browser.new(:chrome, capabilities)
|
111
115
|
@browser.goto(url)
|
112
116
|
if wait_for_loaded
|
113
|
-
|
117
|
+
# MEMO:
|
118
|
+
# Because it may not be updated
|
119
|
+
# Make sure that the launched local storage is updated reliably
|
120
|
+
Watir::Wait.until do
|
121
|
+
old_storage = @browser.driver.local_storage[storage_key].dup
|
122
|
+
@browser.driver.local_storage[storage_key] = new_storage = @schema_doc_from_local
|
123
|
+
old_storage != new_storage
|
124
|
+
end
|
114
125
|
@browser.refresh
|
115
126
|
end
|
116
127
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'r2-oas/schema/v3/manager/file_manager'
|
4
|
+
|
5
|
+
module R2OAS
|
6
|
+
module Schema
|
7
|
+
class FileManager
|
8
|
+
extend Forwardable
|
9
|
+
|
10
|
+
def_delegators :@manager, :save, :delete
|
11
|
+
|
12
|
+
def initialize(path, path_type = :ref)
|
13
|
+
case ::R2OAS.version
|
14
|
+
when :v3
|
15
|
+
@manager = V3::FileManager.new(path, path_type)
|
16
|
+
else
|
17
|
+
raise "Do not support version: #{::R2OAS.version}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class << self
|
22
|
+
alias build new
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/r2-oas/schema/ui.rb
CHANGED
@@ -26,14 +26,13 @@ module R2OAS
|
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
attr_accessor :edited_schema_file_path
|
30
29
|
attr_accessor :existing_schema_file_path
|
31
30
|
attr_accessor :type
|
32
31
|
|
33
32
|
def create_after_schema_data
|
34
33
|
case @type
|
35
34
|
when :edited
|
36
|
-
|
35
|
+
{}
|
37
36
|
when :existing
|
38
37
|
if existing_schema_file_path.present?
|
39
38
|
create_after_schema_data_when_specify_path
|
@@ -43,10 +42,6 @@ module R2OAS
|
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
46
|
-
def create_after_schema_data_when_edited
|
47
|
-
YAML.load_file(edited_schema_file_path)
|
48
|
-
end
|
49
|
-
|
50
45
|
def create_after_schema_data_when_not_specify_path
|
51
46
|
if FileTest.exists?(doc_save_file_path)
|
52
47
|
YAML.load_file(doc_save_file_path)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'forwardable'
|
5
|
+
require 'r2-oas/routing/parser'
|
6
|
+
require_relative 'builder/doc_builder'
|
7
|
+
require_relative 'builder/base_builder'
|
8
|
+
|
9
|
+
module R2OAS
|
10
|
+
module Schema
|
11
|
+
module V3
|
12
|
+
class Builder < BaseBuilder
|
13
|
+
extend Forwardable
|
14
|
+
|
15
|
+
def_delegators :@doc_builder, :oas_doc
|
16
|
+
|
17
|
+
def initialize(options = {})
|
18
|
+
super
|
19
|
+
@doc_builder = DocBuilder.new(options)
|
20
|
+
end
|
21
|
+
|
22
|
+
def build_docs
|
23
|
+
@doc_builder.build_docs
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'r2-oas/schema/v3/base'
|
4
|
+
require 'r2-oas/routing/parser'
|
5
|
+
require 'r2-oas/schema/v3/object/openapi_object'
|
6
|
+
require 'r2-oas/schema/v3/manager/file/path_item_file_manager'
|
7
|
+
|
8
|
+
module R2OAS
|
9
|
+
module Schema
|
10
|
+
module V3
|
11
|
+
class BaseBuilder < Base
|
12
|
+
include Sortable
|
13
|
+
|
14
|
+
def initialize(options = {})
|
15
|
+
super
|
16
|
+
@glob_schema_paths = create_glob_schema_paths
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_accessor :unit_paths_file_path
|
22
|
+
attr_accessor :skip_load_dot_paths
|
23
|
+
|
24
|
+
def schema_file_do_not_exists?
|
25
|
+
schema_files_paths.count == 0
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_glob_schema_paths
|
29
|
+
exclude_paths_regexp_paths = ["#{schema_save_dir_path}/**.yml"]
|
30
|
+
components_security_schemes_regexp_paths = ["#{schema_save_dir_path}/components/securitySchemes/**/**.yml"]
|
31
|
+
|
32
|
+
# components/securitySchemes is not referenced in $ ref.
|
33
|
+
exclude_paths_regexp_paths + many_paths_file_paths + many_components_file_paths + components_security_schemes_regexp_paths
|
34
|
+
end
|
35
|
+
|
36
|
+
def schema_files_paths
|
37
|
+
Dir.glob(@glob_schema_paths)
|
38
|
+
end
|
39
|
+
|
40
|
+
def many_paths_file_paths
|
41
|
+
if unit_paths_file_path.present? && !skip_load_dot_paths
|
42
|
+
[unit_paths_file_path]
|
43
|
+
elsif !unit_paths_file_path.present? && !skip_load_dot_paths && paths_config.all_load_paths?
|
44
|
+
paths_config.many_paths_file_paths
|
45
|
+
else
|
46
|
+
Dir.glob("#{schema_save_dir_path}/paths/**/**.yml")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def many_components_file_paths
|
51
|
+
@many_components_file_paths ||= many_paths_file_paths.each_with_object([]) do |unit_paths_path, result|
|
52
|
+
file_manager = PathItemFileManager.new(unit_paths_path, :full)
|
53
|
+
components_file_paths_at_path = file_manager.descendants_ref_paths
|
54
|
+
result.push(*components_file_paths_at_path)
|
55
|
+
end.uniq
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'fileutils'
|
5
|
+
require_relative 'base_builder'
|
6
|
+
|
7
|
+
module R2OAS
|
8
|
+
module Schema
|
9
|
+
module V3
|
10
|
+
class DocBuilder < BaseBuilder
|
11
|
+
attr_accessor :oas_doc
|
12
|
+
|
13
|
+
def build_docs
|
14
|
+
logger.info '[Build OAS schema files] start'
|
15
|
+
logger.info '[Build OAS docs from schema files] start'
|
16
|
+
build_docs_from_schema_files
|
17
|
+
logger.info '[Build OAS docs from schema files] end'
|
18
|
+
logger.info '[Build OAS schema files] end'
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def build_docs_from_schema_files
|
24
|
+
result_before_squeeze = schema_files_paths.each_with_object({}) do |path, data|
|
25
|
+
file_manager = FileManager.new(path)
|
26
|
+
yaml = YAML.load_file(path)
|
27
|
+
data.deep_merge!(yaml)
|
28
|
+
logger.info " Use schema file: \t#{file_manager.save_file_path(type: :relative)}"
|
29
|
+
end
|
30
|
+
|
31
|
+
result = if many_paths_file_paths.present?
|
32
|
+
Squeezer.new(result_before_squeeze, many_paths_file_paths: many_paths_file_paths).squeeze_docs
|
33
|
+
else
|
34
|
+
result_before_squeeze
|
35
|
+
end
|
36
|
+
|
37
|
+
@oas_doc = result
|
38
|
+
File.write(doc_save_file_path, result.to_yaml)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -12,16 +12,12 @@ module R2OAS
|
|
12
12
|
class Generator < BaseGenerator
|
13
13
|
extend Forwardable
|
14
14
|
|
15
|
-
def_delegators :@doc_generator, :
|
15
|
+
def_delegators :@doc_generator, :generate_docs
|
16
16
|
|
17
17
|
def initialize(options = {})
|
18
18
|
super
|
19
19
|
@doc_generator = DocGenerator.new(options)
|
20
20
|
end
|
21
|
-
|
22
|
-
def generate_docs
|
23
|
-
@doc_generator.generate_docs
|
24
|
-
end
|
25
21
|
end
|
26
22
|
end
|
27
23
|
end
|
@@ -4,6 +4,7 @@ require 'r2-oas/schema/v3/base'
|
|
4
4
|
require 'r2-oas/routing/parser'
|
5
5
|
require 'r2-oas/schema/v3/object/openapi_object'
|
6
6
|
require 'r2-oas/schema/v3/manager/file/path_item_file_manager'
|
7
|
+
require 'r2-oas/store'
|
7
8
|
|
8
9
|
module R2OAS
|
9
10
|
module Schema
|
@@ -13,14 +14,16 @@ module R2OAS
|
|
13
14
|
|
14
15
|
def initialize(options = {})
|
15
16
|
super
|
17
|
+
@store = Store.create
|
16
18
|
@glob_schema_paths = create_glob_schema_paths
|
17
19
|
end
|
18
20
|
|
19
21
|
private
|
20
22
|
|
21
23
|
attr_accessor :unit_paths_file_path
|
22
|
-
attr_accessor :skip_generate_docs
|
23
24
|
attr_accessor :skip_load_dot_paths
|
25
|
+
attr_accessor :is_create_cache
|
26
|
+
attr_accessor :store
|
24
27
|
|
25
28
|
# Scope Rails
|
26
29
|
def create_docs
|
@@ -82,6 +85,32 @@ module R2OAS
|
|
82
85
|
def exists_paths_files?
|
83
86
|
Dir.glob("#{schema_save_dir_path}/paths/**/**.yml").present?
|
84
87
|
end
|
88
|
+
|
89
|
+
def cache_docs
|
90
|
+
if exists_cache?
|
91
|
+
result = IO.binread(abs_cache_docs_path)
|
92
|
+
inflate = Zlib::Inflate.inflate(result)
|
93
|
+
@cache_docs ||= Marshal.load(inflate)
|
94
|
+
else
|
95
|
+
@cache_docs ||= {}
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def exists_cache?
|
100
|
+
FileTest.exists?(abs_cache_docs_path)
|
101
|
+
end
|
102
|
+
|
103
|
+
def abs_cache_docs_path
|
104
|
+
File.expand_path(relative_cahe_docs_path)
|
105
|
+
end
|
106
|
+
|
107
|
+
def relative_cahe_docs_path
|
108
|
+
"#{@root_dir_path}/.docs"
|
109
|
+
end
|
110
|
+
|
111
|
+
def unknown_paths_path
|
112
|
+
"#{@root_dir_path}/src/paths/unknown.yml"
|
113
|
+
end
|
85
114
|
end
|
86
115
|
end
|
87
116
|
end
|
@@ -20,37 +20,17 @@ module R2OAS
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def generate_docs
|
23
|
-
|
24
|
-
|
25
|
-
generate_docs_from_routes_data
|
26
|
-
else
|
27
|
-
logger.info ' <From schema files>'
|
28
|
-
generate_docs_from_schema_fiels
|
29
|
-
end
|
23
|
+
logger.info ' <From routes data>'
|
24
|
+
generate_docs_from_routes_data
|
30
25
|
end
|
31
26
|
|
32
27
|
private
|
33
28
|
|
34
29
|
alias components_objects_files_paths schema_files_paths
|
35
|
-
alias components_objects_file_do_not_exists? schema_file_do_not_exists?
|
36
|
-
|
37
|
-
def generate_docs_from_schema_fiels
|
38
|
-
components_schemas_from_schema_files = components_objects_files_paths.each_with_object({}) do |path, data|
|
39
|
-
yaml = YAML.load_file(path)
|
40
|
-
data.deep_merge!(yaml)
|
41
|
-
full_path = File.expand_path(path, './')
|
42
|
-
logger.info " Fetch Components schema file: \t#{full_path}"
|
43
|
-
end
|
44
|
-
@components_objects.deep_merge!(components_schemas_from_schema_files[@major_category][@middle_category])
|
45
|
-
|
46
|
-
process_when_generate_docs do |save_file_path|
|
47
|
-
logger.info " Merge schema file: \t#{save_file_path}"
|
48
|
-
end
|
49
|
-
end
|
50
30
|
|
51
31
|
def generate_docs_from_routes_data
|
52
32
|
process_when_generate_docs do |save_file_path|
|
53
|
-
logger.info "
|
33
|
+
logger.info " Add schema file into store: \t#{save_file_path}"
|
54
34
|
end
|
55
35
|
end
|
56
36
|
|
@@ -65,9 +45,10 @@ module R2OAS
|
|
65
45
|
|
66
46
|
relative_path = "#{@major_category}/#{@middle_category}/#{schema_name}"
|
67
47
|
file_manager = ComponentsFileManager.build(relative_path, :relative)
|
68
|
-
file_manager.
|
48
|
+
save_file_path = file_manager.save_file_path(type: :relative)
|
49
|
+
store.add(save_file_path, result.to_yaml)
|
69
50
|
|
70
|
-
yield
|
51
|
+
yield save_file_path if block_given?
|
71
52
|
end
|
72
53
|
end
|
73
54
|
|