forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel_MappedModel.jl
More file actions
48 lines (37 loc) · 1.6 KB
/
model_MappedModel.jl
File metadata and controls
48 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
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
47
48
# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.
@doc raw"""another_model
to test mapping features
MappedModel(;
mappedProperty=nothing,
uuid_default_value=nothing,
)
- mappedProperty::Int64
- uuid_default_value::String
"""
Base.@kwdef mutable struct MappedModel <: OpenAPI.APIModel
mappedProperty::Union{Nothing, Int64} = nothing
uuid_default_value::Union{Nothing, String} = nothing
function MappedModel(mappedProperty, uuid_default_value, )
o = new(mappedProperty, uuid_default_value, )
OpenAPI.validate_properties(o)
return o
end
end # type MappedModel
const _property_types_MappedModel = Dict{Symbol,String}(Symbol("another_property")=>"Int64", Symbol("uuid_default_value")=>"String", )
OpenAPI.property_type(::Type{ MappedModel }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_MappedModel[name]))}
function OpenAPI.check_required(o::MappedModel)
true
end
function OpenAPI.validate_properties(o::MappedModel)
OpenAPI.validate_property(MappedModel, Symbol("another_property"), o.mappedProperty)
OpenAPI.validate_property(MappedModel, Symbol("uuid_default_value"), o.uuid_default_value)
end
function OpenAPI.validate_property(::Type{ MappedModel }, name::Symbol, val)
if name === Symbol("another_property")
OpenAPI.validate_param(name, "MappedModel", :format, val, "int32")
end
if name === Symbol("uuid_default_value")
OpenAPI.validate_param(name, "MappedModel", :format, val, "uuid")
end
end