forked from loafle/openapi-generator-original
For each object and a decoder that can handle an array of objects.
Otherwise REST endpoints that return a list of resources can't be used.
This commit is contained in:
parent
8836644d37
commit
cf8d8deacd
@ -118,6 +118,10 @@ class Decoders {
|
|||||||
fatalError("formatter failed to parse \(sourceString)")
|
fatalError("formatter failed to parse \(sourceString)")
|
||||||
} {{#models}}{{#model}}
|
} {{#models}}{{#model}}
|
||||||
|
|
||||||
|
// Decoder for [{{{classname}}}]
|
||||||
|
Decoders.addDecoder(clazz: [{{{classname}}}].self) { (source: AnyObject) -> [{{{classname}}}] in
|
||||||
|
return Decoders.decode(clazz: [{{{classname}}}].self, source: source)
|
||||||
|
}
|
||||||
// Decoder for {{{classname}}}
|
// Decoder for {{{classname}}}
|
||||||
Decoders.addDecoder(clazz: {{{classname}}}.self) { (source: AnyObject) -> {{{classname}}} in
|
Decoders.addDecoder(clazz: {{{classname}}}.self) { (source: AnyObject) -> {{{classname}}} in
|
||||||
let sourceDictionary = source as! [NSObject:AnyObject]
|
let sourceDictionary = source as! [NSObject:AnyObject]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user