swagger_yard 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/swagger_yard/model.rb +6 -2
- data/lib/swagger_yard/type_parser.rb +2 -2
- data/lib/swagger_yard/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 83e1c4a1e03bfda00de8186e1c4ff6295cd80cc48d1053cd50f7f334ffe328fb
|
4
|
+
data.tar.gz: f0c8fd6215987665d201f921ccc4421a4f623c4c527867b01328f3279147b123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8589dd0a10c513d877c27efcae067cebc61fcc7855c2a12c0a85c84db42007e63860f284afce8b63e7afb3f3372a1c035c806eb98d004a3ac9284c32b07324ff
|
7
|
+
data.tar.gz: 3d9d1203cea5812416f6838207e3f114f009653d8e1f787baea890260180652d5f337ce2cf6dcadb213a58e0503a674098fad98c841b41ecf366db08b5bfb8eb
|
data/lib/swagger_yard/model.rb
CHANGED
@@ -41,8 +41,12 @@ module SwaggerYard
|
|
41
41
|
properties.detect {|prop| prop.name == key }
|
42
42
|
end
|
43
43
|
|
44
|
+
TAG_ORDER = %w(model inherits discriminator property example)
|
45
|
+
|
44
46
|
def parse_tags(tags)
|
45
|
-
tags.
|
47
|
+
sorted_tags = tags.each_with_index.sort_by { |t,i|
|
48
|
+
[TAG_ORDER.index(t.tag_name), i] }.map(&:first)
|
49
|
+
sorted_tags.each do |tag|
|
46
50
|
case tag.tag_name
|
47
51
|
when "model"
|
48
52
|
@has_model_tag = true
|
@@ -63,7 +67,7 @@ module SwaggerYard
|
|
63
67
|
if (prop = property(tag.name))
|
64
68
|
prop.example = tag.text
|
65
69
|
else
|
66
|
-
SwaggerYard.log.warn("no property '#{tag.name}' defined yet to which to attach example: #{
|
70
|
+
SwaggerYard.log.warn("no property '#{tag.name}' defined yet to which to attach example: #{tag.text.inspect}")
|
67
71
|
end
|
68
72
|
else
|
69
73
|
self.example = tag.text
|
@@ -58,9 +58,9 @@ module SwaggerYard
|
|
58
58
|
rule(identifier: simple(:id)) do
|
59
59
|
v = id.to_s
|
60
60
|
case v
|
61
|
-
when
|
61
|
+
when /^array$/i
|
62
62
|
{ 'type' => 'array', 'items' => { 'type' => 'string' } }
|
63
|
-
when
|
63
|
+
when /^object$/i
|
64
64
|
{ 'type' => 'object' }
|
65
65
|
when "float", "double"
|
66
66
|
{ 'type' => 'number', 'format' => v }
|
data/lib/swagger_yard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger_yard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chtrinh (Chris Trinh)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.7.4
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: SwaggerYard API doc through YARD
|