meta-api 0.0.7 → 0.0.9
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/CHANGELOG.md +14 -0
- data/lib/meta/application/execution.rb +19 -49
- data/lib/meta/application/metadata.rb +65 -5
- data/lib/meta/application/route.rb +4 -26
- data/lib/meta/config.rb +14 -14
- data/lib/meta/json_schema/builders/schema_builder_tool.rb +2 -1
- data/lib/meta/json_schema/schemas/array_schema.rb +13 -14
- data/lib/meta/json_schema/schemas/base_schema.rb +101 -36
- data/lib/meta/json_schema/schemas/object_schema.rb +22 -9
- data/lib/meta/json_schema/schemas/properties.rb +20 -74
- data/lib/meta/json_schema/schemas/scoping_schema.rb +41 -0
- data/lib/meta/json_schema/schemas/staging_schema.rb +58 -0
- data/lib/meta/json_schema/schemas/unsupported_schema.rb +22 -0
- data/lib/meta/json_schema/support/errors.rb +3 -0
- data/lib/meta/json_schema/support/schema_options.rb +0 -9
- data/lib/meta/route_dsl/meta_builder.rb +2 -2
- data/lib/meta/route_dsl/uniformed_params_builder.rb +5 -5
- data/lib/meta/swagger_doc.rb +1 -1
- data/lib/meta/utils/kwargs/builder.rb +2 -0
- data/lib/meta/utils/route_dsl_builders.rb +1 -0
- data/meta-api.gemspec +6 -5
- metadata +71 -111
- data/.autoenv.zsh +0 -1
- data/.gitignore +0 -7
- data/.rubocop.yml +0 -28
- data/Gemfile +0 -18
- data/Gemfile.lock +0 -66
- data/README.md +0 -166
- data/Rakefile +0 -3
- data/docs/Rails.md +0 -61
- data/docs//345/220/215/347/247/260/347/224/261/346/235/245.md +0 -7
- data/docs//345/246/202/344/275/225/350/264/241/347/214/256.md +0 -10
- data/docs//346/225/231/347/250/213.md +0 -1647
- data/docs//347/264/242/345/274/225.md +0 -183
- data/examples/lobster.rb +0 -71
- data/examples/rack_app/README.md +0 -3
- data/examples/rack_app/config.ru +0 -6
- data/examples/rack_app/hello.rb +0 -6
- data/examples/rack_app/timing.rb +0 -15
- data/examples/rails_app/.gitattributes +0 -5
- data/examples/rails_app/.gitignore +0 -23
- data/examples/rails_app/.rspec +0 -1
- data/examples/rails_app/.ruby-version +0 -1
- data/examples/rails_app/Gemfile +0 -29
- data/examples/rails_app/Gemfile.lock +0 -190
- data/examples/rails_app/README.md +0 -11
- data/examples/rails_app/Rakefile +0 -6
- data/examples/rails_app/app/controllers/application_controller.rb +0 -7
- data/examples/rails_app/app/controllers/concerns/.keep +0 -0
- data/examples/rails_app/app/controllers/data_controller.rb +0 -63
- data/examples/rails_app/app/controllers/swagger_controller.rb +0 -13
- data/examples/rails_app/app/models/concerns/.keep +0 -0
- data/examples/rails_app/bin/rails +0 -4
- data/examples/rails_app/bin/rake +0 -4
- data/examples/rails_app/bin/setup +0 -25
- data/examples/rails_app/config/application.rb +0 -39
- data/examples/rails_app/config/boot.rb +0 -3
- data/examples/rails_app/config/credentials.yml.enc +0 -1
- data/examples/rails_app/config/environment.rb +0 -5
- data/examples/rails_app/config/environments/development.rb +0 -51
- data/examples/rails_app/config/environments/production.rb +0 -65
- data/examples/rails_app/config/environments/test.rb +0 -50
- data/examples/rails_app/config/initializers/cors.rb +0 -16
- data/examples/rails_app/config/initializers/filter_parameter_logging.rb +0 -8
- data/examples/rails_app/config/initializers/inflections.rb +0 -16
- data/examples/rails_app/config/initializers/meta_rails_plugin.rb +0 -3
- data/examples/rails_app/config/locales/en.yml +0 -33
- data/examples/rails_app/config/puma.rb +0 -43
- data/examples/rails_app/config/routes.rb +0 -13
- data/examples/rails_app/config.ru +0 -6
- data/examples/rails_app/lib/tasks/.keep +0 -0
- data/examples/rails_app/log/.keep +0 -0
- data/examples/rails_app/public/robots.txt +0 -1
- data/examples/rails_app/spec/data_controller_spec.rb +0 -60
- data/examples/rails_app/spec/rails_helper.rb +0 -55
- data/examples/rails_app/spec/spec_helper.rb +0 -94
- data/examples/rails_app/spec/swagger_controller_spec.rb +0 -13
- data/examples/rails_app/tmp/.keep +0 -0
- data/examples/rails_app/tmp/pids/.keep +0 -0
@@ -5,65 +5,6 @@ require 'forwardable'
|
|
5
5
|
module Meta
|
6
6
|
module JsonSchema
|
7
7
|
class Properties
|
8
|
-
class StagingProperty
|
9
|
-
def initialize(param:, render:, none:)
|
10
|
-
@param_stage = param
|
11
|
-
@render_stage = render
|
12
|
-
@none_stage = none
|
13
|
-
end
|
14
|
-
|
15
|
-
def stage(stage = nil)
|
16
|
-
case stage
|
17
|
-
when :param
|
18
|
-
@param_stage
|
19
|
-
when :render
|
20
|
-
@render_stage
|
21
|
-
else
|
22
|
-
@none_stage
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def stage?(stage)
|
27
|
-
stage(stage) != nil
|
28
|
-
end
|
29
|
-
|
30
|
-
def schema(stage = nil)
|
31
|
-
stage(stage).schema
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.build(options, build_schema)
|
35
|
-
param_opts, render_opts, common_opts = SchemaOptions.divide_to_param_and_render(options)
|
36
|
-
|
37
|
-
StagingProperty.new(
|
38
|
-
param: options[:param] === false ? nil : ScopingProperty.build(param_opts, build_schema),
|
39
|
-
render: options[:render] === false ? nil : ScopingProperty.build(render_opts, build_schema),
|
40
|
-
none: ScopingProperty.build(common_opts, build_schema)
|
41
|
-
)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class ScopingProperty
|
46
|
-
attr_reader :scope, :schema
|
47
|
-
|
48
|
-
def initialize(scope: :all, schema:)
|
49
|
-
scope = :all if scope.nil?
|
50
|
-
scope = [scope] unless scope.is_a?(Array) || scope == :all
|
51
|
-
if scope.is_a?(Array) && scope.any? { |s| s.is_a?(Integer) }
|
52
|
-
raise ArgumentError, 'scope 选项内不可传递数字'
|
53
|
-
end
|
54
|
-
@scope = scope
|
55
|
-
|
56
|
-
@schema = schema
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.build(options, build_schema)
|
60
|
-
options = options.dup
|
61
|
-
scope = options.delete(:scope)
|
62
|
-
schema = build_schema.call(options)
|
63
|
-
ScopingProperty.new(scope: scope, schema: schema)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
8
|
extend Forwardable
|
68
9
|
|
69
10
|
def initialize(properties)
|
@@ -77,13 +18,16 @@ module Meta
|
|
77
18
|
user_scope = user_options[:scope] || [0]
|
78
19
|
exclude = user_options.delete(:exclude) # 这里删除 exclude 选项,不要传递给下一层
|
79
20
|
properties = filter_by(stage: stage, user_scope: user_scope)
|
80
|
-
filtered_properties = properties.filter do |name,
|
21
|
+
filtered_properties = properties.filter do |name, property_schema|
|
81
22
|
# 通过 discard_missing 过滤
|
82
23
|
next false if user_options[:discard_missing] && !object_value.key?(name.to_s)
|
83
24
|
|
84
25
|
# 通过 locked_exclude 选项过滤
|
85
26
|
next false if exclude && exclude.include?(name)
|
86
27
|
|
28
|
+
# 通过 if 选项过滤
|
29
|
+
next false unless property_schema.if?(user_options)
|
30
|
+
|
87
31
|
# 默认返回 true
|
88
32
|
next true
|
89
33
|
end
|
@@ -91,12 +35,14 @@ module Meta
|
|
91
35
|
# 第二步,递归过滤每一个属性
|
92
36
|
object = {}
|
93
37
|
errors = {}
|
38
|
+
cause = nil
|
94
39
|
filtered_properties.each do |name, property_schema|
|
95
40
|
value = resolve_property_value(object_value, name, property_schema)
|
96
41
|
|
97
42
|
begin
|
98
43
|
object[name] = property_schema.filter(value, **user_options, object_value: object_value)
|
99
44
|
rescue JsonSchema::ValidationErrors => e
|
45
|
+
cause = e.cause || e if cause.nil? # 将第一次出现的错误作为 cause
|
100
46
|
errors.merge! e.prepend_root(name).errors
|
101
47
|
end
|
102
48
|
end.to_h
|
@@ -108,18 +54,25 @@ module Meta
|
|
108
54
|
|
109
55
|
if errors.empty?
|
110
56
|
object
|
57
|
+
elsif cause
|
58
|
+
begin
|
59
|
+
raise cause
|
60
|
+
rescue
|
61
|
+
raise JsonSchema::ValidationErrors.new(errors)
|
62
|
+
end
|
111
63
|
else
|
112
64
|
raise JsonSchema::ValidationErrors.new(errors)
|
113
65
|
end
|
114
66
|
end
|
115
67
|
|
116
|
-
def to_swagger_doc(
|
68
|
+
def to_swagger_doc(scope: [], stage: nil, **user_options)
|
69
|
+
locked_scopes = scope
|
117
70
|
properties = filter_by(stage: stage, user_scope: locked_scopes)
|
118
71
|
required_keys = properties.filter do |key, property_schema|
|
119
72
|
property_schema.options[:required]
|
120
73
|
end.keys
|
121
74
|
properties = properties.transform_values do |property_schema |
|
122
|
-
property_schema.to_schema_doc(stage: stage, **user_options)
|
75
|
+
property_schema.to_schema_doc(stage: stage, scope: scope, **user_options)
|
123
76
|
end
|
124
77
|
[properties, required_keys]
|
125
78
|
end
|
@@ -132,23 +85,16 @@ module Meta
|
|
132
85
|
end
|
133
86
|
|
134
87
|
def self.build_property(*args)
|
135
|
-
|
88
|
+
StagingSchema.build_from_options(*args)
|
136
89
|
end
|
137
90
|
|
138
91
|
private
|
139
92
|
|
140
93
|
def filter_by(stage:, user_scope: false)
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
# 通过 user_scope 过滤
|
147
|
-
next true if property.scope == :all
|
148
|
-
(user_scope - property.scope).empty? # user_scope 应被消耗殆尽
|
149
|
-
end
|
150
|
-
properties.transform_values do |property|
|
151
|
-
property.stage(stage).schema
|
94
|
+
@properties.transform_values do |property|
|
95
|
+
property.find_schema(stage: stage, scope: user_scope)
|
96
|
+
end.filter do |name, schema|
|
97
|
+
schema.filter?
|
152
98
|
end
|
153
99
|
end
|
154
100
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Meta
|
4
|
+
module JsonSchema
|
5
|
+
class ScopingSchema < BaseSchema
|
6
|
+
attr_reader :on, :schema
|
7
|
+
|
8
|
+
def initialize(required_scope: [], schema:)
|
9
|
+
raise ArgumentError, 'required_scope 选项不可传递 nil' if required_scope.nil?
|
10
|
+
required_scope = [required_scope] unless required_scope.is_a?(Array)
|
11
|
+
|
12
|
+
@on = required_scope
|
13
|
+
@schema = schema
|
14
|
+
end
|
15
|
+
|
16
|
+
def scoped(user_scopes)
|
17
|
+
return schema if (on - user_scopes).empty? # required_scopes 应被消耗殆尽
|
18
|
+
|
19
|
+
UnsupportedSchema.new(:on, user_scopes)
|
20
|
+
end
|
21
|
+
|
22
|
+
STAGING_SCHEMA_OPTIONS = Utils::KeywordArgs::Builder.build do
|
23
|
+
permit_extras true
|
24
|
+
|
25
|
+
# TODO: 如果我想把 on 改名为 require_scopes,关键字参数的机制是否支持?
|
26
|
+
key :on, alias_names: [:scope], default: [], normalizer: ->(required_scopes) {
|
27
|
+
required_scopes = [] if required_scopes.nil?
|
28
|
+
required_scopes = [required_scopes] unless required_scopes.is_a?(Array)
|
29
|
+
required_scopes
|
30
|
+
}
|
31
|
+
end
|
32
|
+
def self.build_from_options(options, build_schema)
|
33
|
+
options = STAGING_SCHEMA_OPTIONS.check(options)
|
34
|
+
required_scope = options.delete(:on) || []
|
35
|
+
schema = build_schema.call(options)
|
36
|
+
schema = ScopingSchema.new(required_scope: required_scope, schema: schema) unless required_scope.empty?
|
37
|
+
schema
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../utils/kwargs/check'
|
4
|
+
require_relative '../support/schema_options'
|
5
|
+
require_relative 'scoping_schema'
|
6
|
+
require_relative 'unsupported_schema'
|
7
|
+
|
8
|
+
module Meta
|
9
|
+
module JsonSchema
|
10
|
+
# 内含 param_schema, render_schema, default_schema,分别用于不同的阶段。
|
11
|
+
class StagingSchema < BaseSchema
|
12
|
+
attr_reader :param_schema, :render_schema, :default_schema
|
13
|
+
|
14
|
+
def initialize(param_schema:, render_schema:, default_schema:)
|
15
|
+
raise ArgumentError, 'param_schema 选项重复提交为 StagingSchema' if param_schema.is_a?(StagingSchema)
|
16
|
+
raise ArgumentError, 'render_schema 选项重复提交为 StagingSchema' if render_schema.is_a?(StagingSchema)
|
17
|
+
raise ArgumentError, 'default_schema 选项重复提交为 StagingSchema' if default_schema.is_a?(StagingSchema)
|
18
|
+
|
19
|
+
@param_schema = param_schema
|
20
|
+
@render_schema = render_schema
|
21
|
+
@default_schema = default_schema
|
22
|
+
end
|
23
|
+
|
24
|
+
def filter(value, user_options = {})
|
25
|
+
if user_options[:stage] == :param
|
26
|
+
param_schema.filter(value, user_options)
|
27
|
+
elsif user_options[:stage] == :render
|
28
|
+
render_schema.filter(value, user_options)
|
29
|
+
else
|
30
|
+
default_schema.filter(value, user_options)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def staged(stage)
|
35
|
+
if stage == :param
|
36
|
+
param_schema
|
37
|
+
elsif stage == :render
|
38
|
+
render_schema
|
39
|
+
else
|
40
|
+
default_schema
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.build_from_options(options, build_schema = ->(opts) { BaseSchema.new(opts) })
|
45
|
+
param_opts, render_opts, common_opts = SchemaOptions.divide_to_param_and_render(options)
|
46
|
+
if param_opts == common_opts && render_opts == common_opts
|
47
|
+
return ScopingSchema.build_from_options(common_opts, build_schema)
|
48
|
+
else
|
49
|
+
StagingSchema.new(
|
50
|
+
param_schema: param_opts ? ScopingSchema.build_from_options(param_opts, build_schema) : UnsupportedSchema.new(:stage, :param),
|
51
|
+
render_schema: render_opts ? ScopingSchema.build_from_options(render_opts, build_schema) : UnsupportedSchema.new(:stage, :render),
|
52
|
+
default_schema: ScopingSchema.build_from_options(common_opts, build_schema),
|
53
|
+
)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Meta
|
4
|
+
module JsonSchema
|
5
|
+
class UnsupportedSchema < BaseSchema
|
6
|
+
attr_reader :key, :value
|
7
|
+
|
8
|
+
def initialize(key, value)
|
9
|
+
@key = key
|
10
|
+
@value = value
|
11
|
+
end
|
12
|
+
|
13
|
+
def filter?
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
def filter(value, options)
|
18
|
+
raise UnsupportedError, "不支持的 #{key}: #{value}}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -9,11 +9,6 @@ module Meta
|
|
9
9
|
scope: [],
|
10
10
|
required: false
|
11
11
|
}
|
12
|
-
@allowable_options = (
|
13
|
-
%i[type description in value using default presenter convert scope items using] +
|
14
|
-
@default_options.keys +
|
15
|
-
JsonSchema::Validators.keys
|
16
|
-
).uniq
|
17
12
|
|
18
13
|
class << self
|
19
14
|
def divide_to_param_and_render(options)
|
@@ -37,10 +32,6 @@ module Meta
|
|
37
32
|
end
|
38
33
|
end
|
39
34
|
|
40
|
-
# 处理 validators
|
41
|
-
unknown_validators = options.keys - @allowable_options
|
42
|
-
raise "未知的选项:#{unknown_validators.join(', ')}" unless unknown_validators.empty?
|
43
|
-
|
44
35
|
options
|
45
36
|
end
|
46
37
|
|
@@ -9,7 +9,7 @@ module Meta
|
|
9
9
|
def initialize(route_full_path:, route_method: :all, &block)
|
10
10
|
@route_full_path = route_full_path
|
11
11
|
@method = route_method
|
12
|
-
@meta = {}
|
12
|
+
@meta = { scope: [] }
|
13
13
|
@parameters_builder = ParametersBuilder.new(route_full_path: route_full_path, route_method: route_method) # 默认给一个空的参数构建器,它只会处理 path 参数
|
14
14
|
|
15
15
|
instance_exec &block if block_given?
|
@@ -43,7 +43,7 @@ module Meta
|
|
43
43
|
codes.each { |code| @meta[:responses][code] = entity_schema }
|
44
44
|
end
|
45
45
|
|
46
|
-
[:tags, :title, :description].each do |method_name|
|
46
|
+
[:tags, :title, :description, :scope].each do |method_name|
|
47
47
|
define_method(method_name) do |value|
|
48
48
|
@meta[method_name] = value
|
49
49
|
end
|
@@ -15,16 +15,16 @@ module Meta
|
|
15
15
|
|
16
16
|
def param(name, options = {}, &block)
|
17
17
|
options = (options || {}).dup
|
18
|
-
in_op = options.delete(:in) || \
|
19
18
|
if path_param_names.include?(name)
|
20
|
-
'path'
|
19
|
+
options = Utils::KeywordArgs::Checker.fix!(options, in: 'path', required: true)
|
21
20
|
elsif @route_method == :get
|
22
|
-
'query'
|
21
|
+
options = Utils::KeywordArgs::Checker.merge_defaults!(options, in: 'query')
|
23
22
|
else
|
24
|
-
'body'
|
23
|
+
options = Utils::KeywordArgs::Checker.merge_defaults!(options, in: 'body')
|
25
24
|
end
|
26
25
|
|
27
|
-
if
|
26
|
+
if options[:in] == 'body'
|
27
|
+
options.delete(:in)
|
28
28
|
property name, options, &block
|
29
29
|
else
|
30
30
|
@parameters_builder.param name, options
|
data/lib/meta/swagger_doc.rb
CHANGED
@@ -58,6 +58,7 @@ module Meta
|
|
58
58
|
def initialize(name:, normalizer: DEFAULT_TRANSFORMER, validator: nil, default: nil, alias_names: [])
|
59
59
|
@key_name = name
|
60
60
|
@consumer_names = [name] + alias_names
|
61
|
+
# TODO: 当且仅当 value 是 nil 时,才使用 default
|
61
62
|
@normalizer = default ? ->(value) { normalizer.call(value || default) } : normalizer
|
62
63
|
@validator = validator
|
63
64
|
end
|
@@ -70,6 +71,7 @@ module Meta
|
|
70
71
|
end
|
71
72
|
|
72
73
|
def consume_name(final_args, args, consumer_name)
|
74
|
+
# TODO: default 未起作用
|
73
75
|
if args.key?(consumer_name)
|
74
76
|
value = @normalizer.call(args.delete(consumer_name))
|
75
77
|
@validator.call(value) if @validator
|
@@ -15,6 +15,7 @@ module Meta
|
|
15
15
|
if options1[:responses] && options2[:responses]
|
16
16
|
final_options[:responses] = options1[:responses].merge(options2[:responses])
|
17
17
|
end
|
18
|
+
final_options[:scope] = [options1[:scope] || [], options2[:scope] || []].flatten.uniq
|
18
19
|
final_options
|
19
20
|
end
|
20
21
|
|
data/meta-api.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "meta-api"
|
3
|
-
spec.version = "0.0.
|
3
|
+
spec.version = "0.0.9"
|
4
4
|
spec.authors = ["yetrun"]
|
5
5
|
spec.email = ["yetrun@foxmail.com"]
|
6
6
|
|
@@ -14,10 +14,11 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.metadata["homepage_uri"] = spec.homepage
|
15
15
|
spec.metadata["source_code_uri"] = "https://github.com/yetrun/web-frame.git"
|
16
16
|
|
17
|
+
spec.add_dependency "hash_to_struct", "~> 1.0.0"
|
18
|
+
|
17
19
|
# Specify which files should be added to the gem when it is released.
|
18
|
-
|
19
|
-
spec.files
|
20
|
-
|
21
|
-
end
|
20
|
+
spec.files = Dir.glob("{config,lib}/{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
21
|
+
spec.files += %w[CHANGELOG.md LICENSE.txt meta-api.gemspec]
|
22
|
+
|
22
23
|
spec.require_paths = ["lib"]
|
23
24
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yetrun
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-07-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: hash_to_struct
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
13
27
|
description: 一个 Web API 框架,该框架采用定义元信息的方式编写 API,并同步生成 API 文档
|
14
28
|
email:
|
15
29
|
- yetrun@foxmail.com
|
@@ -17,112 +31,58 @@ executables: []
|
|
17
31
|
extensions: []
|
18
32
|
extra_rdoc_files: []
|
19
33
|
files:
|
20
|
-
- ".autoenv.zsh"
|
21
|
-
- ".gitignore"
|
22
|
-
- ".rubocop.yml"
|
23
34
|
- CHANGELOG.md
|
24
|
-
- Gemfile
|
25
|
-
- Gemfile.lock
|
26
35
|
- LICENSE.txt
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
- examples/rails_app/spec/swagger_controller_spec.rb
|
78
|
-
- examples/rails_app/tmp/.keep
|
79
|
-
- examples/rails_app/tmp/pids/.keep
|
80
|
-
- lib/meta/api.rb
|
81
|
-
- lib/meta/application.rb
|
82
|
-
- lib/meta/application/application.rb
|
83
|
-
- lib/meta/application/execution.rb
|
84
|
-
- lib/meta/application/linked_action.rb
|
85
|
-
- lib/meta/application/metadata.rb
|
86
|
-
- lib/meta/application/parameters.rb
|
87
|
-
- lib/meta/application/path_matching_mod.rb
|
88
|
-
- lib/meta/application/route.rb
|
89
|
-
- lib/meta/config.rb
|
90
|
-
- lib/meta/entity.rb
|
91
|
-
- lib/meta/errors.rb
|
92
|
-
- lib/meta/json_schema.rb
|
93
|
-
- lib/meta/json_schema/builders/array_schema_builder.rb
|
94
|
-
- lib/meta/json_schema/builders/dynamic_schema_builder.rb
|
95
|
-
- lib/meta/json_schema/builders/object_schema_builder.rb
|
96
|
-
- lib/meta/json_schema/builders/ref_schema_builder.rb
|
97
|
-
- lib/meta/json_schema/builders/schema_builder_tool.rb
|
98
|
-
- lib/meta/json_schema/schemas.rb
|
99
|
-
- lib/meta/json_schema/schemas/array_schema.rb
|
100
|
-
- lib/meta/json_schema/schemas/base_schema.rb
|
101
|
-
- lib/meta/json_schema/schemas/dynamic_schema.rb
|
102
|
-
- lib/meta/json_schema/schemas/object_schema.rb
|
103
|
-
- lib/meta/json_schema/schemas/properties.rb
|
104
|
-
- lib/meta/json_schema/schemas/ref_schema.rb
|
105
|
-
- lib/meta/json_schema/support/errors.rb
|
106
|
-
- lib/meta/json_schema/support/presenters.rb
|
107
|
-
- lib/meta/json_schema/support/schema_options.rb
|
108
|
-
- lib/meta/json_schema/support/type_converter.rb
|
109
|
-
- lib/meta/json_schema/support/validators.rb
|
110
|
-
- lib/meta/load_i18n.rb
|
111
|
-
- lib/meta/rails.rb
|
112
|
-
- lib/meta/route_dsl/action_builder.rb
|
113
|
-
- lib/meta/route_dsl/application_builder.rb
|
114
|
-
- lib/meta/route_dsl/around_action_builder.rb
|
115
|
-
- lib/meta/route_dsl/chain_builder.rb
|
116
|
-
- lib/meta/route_dsl/meta_builder.rb
|
117
|
-
- lib/meta/route_dsl/parameters_builder.rb
|
118
|
-
- lib/meta/route_dsl/route_builder.rb
|
119
|
-
- lib/meta/route_dsl/uniformed_params_builder.rb
|
120
|
-
- lib/meta/swagger_doc.rb
|
121
|
-
- lib/meta/utils/kwargs/builder.rb
|
122
|
-
- lib/meta/utils/kwargs/check.rb
|
123
|
-
- lib/meta/utils/kwargs/checker.rb
|
124
|
-
- lib/meta/utils/path.rb
|
125
|
-
- lib/meta/utils/route_dsl_builders.rb
|
36
|
+
- config//locales/zh-CN.yml
|
37
|
+
- lib//meta/api.rb
|
38
|
+
- lib//meta/application.rb
|
39
|
+
- lib//meta/application/application.rb
|
40
|
+
- lib//meta/application/execution.rb
|
41
|
+
- lib//meta/application/linked_action.rb
|
42
|
+
- lib//meta/application/metadata.rb
|
43
|
+
- lib//meta/application/parameters.rb
|
44
|
+
- lib//meta/application/path_matching_mod.rb
|
45
|
+
- lib//meta/application/route.rb
|
46
|
+
- lib//meta/config.rb
|
47
|
+
- lib//meta/entity.rb
|
48
|
+
- lib//meta/errors.rb
|
49
|
+
- lib//meta/json_schema.rb
|
50
|
+
- lib//meta/json_schema/builders/array_schema_builder.rb
|
51
|
+
- lib//meta/json_schema/builders/dynamic_schema_builder.rb
|
52
|
+
- lib//meta/json_schema/builders/object_schema_builder.rb
|
53
|
+
- lib//meta/json_schema/builders/ref_schema_builder.rb
|
54
|
+
- lib//meta/json_schema/builders/schema_builder_tool.rb
|
55
|
+
- lib//meta/json_schema/schemas.rb
|
56
|
+
- lib//meta/json_schema/schemas/array_schema.rb
|
57
|
+
- lib//meta/json_schema/schemas/base_schema.rb
|
58
|
+
- lib//meta/json_schema/schemas/dynamic_schema.rb
|
59
|
+
- lib//meta/json_schema/schemas/object_schema.rb
|
60
|
+
- lib//meta/json_schema/schemas/properties.rb
|
61
|
+
- lib//meta/json_schema/schemas/ref_schema.rb
|
62
|
+
- lib//meta/json_schema/schemas/scoping_schema.rb
|
63
|
+
- lib//meta/json_schema/schemas/staging_schema.rb
|
64
|
+
- lib//meta/json_schema/schemas/unsupported_schema.rb
|
65
|
+
- lib//meta/json_schema/support/errors.rb
|
66
|
+
- lib//meta/json_schema/support/presenters.rb
|
67
|
+
- lib//meta/json_schema/support/schema_options.rb
|
68
|
+
- lib//meta/json_schema/support/type_converter.rb
|
69
|
+
- lib//meta/json_schema/support/validators.rb
|
70
|
+
- lib//meta/load_i18n.rb
|
71
|
+
- lib//meta/rails.rb
|
72
|
+
- lib//meta/route_dsl/action_builder.rb
|
73
|
+
- lib//meta/route_dsl/application_builder.rb
|
74
|
+
- lib//meta/route_dsl/around_action_builder.rb
|
75
|
+
- lib//meta/route_dsl/chain_builder.rb
|
76
|
+
- lib//meta/route_dsl/meta_builder.rb
|
77
|
+
- lib//meta/route_dsl/parameters_builder.rb
|
78
|
+
- lib//meta/route_dsl/route_builder.rb
|
79
|
+
- lib//meta/route_dsl/uniformed_params_builder.rb
|
80
|
+
- lib//meta/swagger_doc.rb
|
81
|
+
- lib//meta/utils/kwargs/builder.rb
|
82
|
+
- lib//meta/utils/kwargs/check.rb
|
83
|
+
- lib//meta/utils/kwargs/checker.rb
|
84
|
+
- lib//meta/utils/path.rb
|
85
|
+
- lib//meta/utils/route_dsl_builders.rb
|
126
86
|
- meta-api.gemspec
|
127
87
|
homepage: https://github.com/yetrun/web-frame
|
128
88
|
licenses:
|
@@ -131,7 +91,7 @@ metadata:
|
|
131
91
|
allowed_push_host: https://rubygems.org
|
132
92
|
homepage_uri: https://github.com/yetrun/web-frame
|
133
93
|
source_code_uri: https://github.com/yetrun/web-frame.git
|
134
|
-
post_install_message:
|
94
|
+
post_install_message:
|
135
95
|
rdoc_options: []
|
136
96
|
require_paths:
|
137
97
|
- lib
|
@@ -146,8 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
106
|
- !ruby/object:Gem::Version
|
147
107
|
version: '0'
|
148
108
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
150
|
-
signing_key:
|
109
|
+
rubygems_version: 3.3.26
|
110
|
+
signing_key:
|
151
111
|
specification_version: 4
|
152
112
|
summary: 一个 Web API 框架
|
153
113
|
test_files: []
|
data/.autoenv.zsh
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
alias rspec="bundle exec rspec"
|