7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/modern/doc_generator/open_api3/schema_default_types.rb', line 7
def _register_default_types!
[Types::String, Types::Strict::String, Types::Coercible::String].each do |t|
register_literal_type(t, type: "string")
end
[Types::Integer, Types::Strict::Integer, Types::Coercible::Integer].each do |t|
register_literal_type(t, type: "integer", format: "int64")
end
[
Types::Bool, Types::Strict::Bool,
Types::True, Types::Strict::True,
Types::False, Types::Strict::False
].each do |t|
register_literal_type(t, type: "boolean")
end
[Types::Float, Types::Strict::Float, Types::Coercible::Float].each do |t|
register_literal_type(t, type: "number", format: "double")
end
[Types::Date, Types::Strict::Date, Types::JSON::Date].each do |t|
register_literal_type(t, type: "string", format: "date")
end
[Types::Time, Types::Strict::Time, Types::JSON::Time].each do |t|
register_literal_type(t, type: "string", format: "date")
end
[Types::Decimal, Types::Strict::Decimal, Types::Coercible::Decimal].each do |t|
register_literal_type(t, type: "number")
end
end
|