Remove encoder requirement to almost all Open API Node constructors. Made a new protocol for the few places where an encoder did need to be passed in.

This commit is contained in:
Mathew Polzin
2019-01-23 23:21:16 -08:00
parent 951c04ad44
commit 952fe8ba7e
6 changed files with 167 additions and 119 deletions
@@ -69,16 +69,16 @@ extension Sampleable {
let maybeOpenAPINode: JSONNode? = try {
switch type(of: child.value) {
case let valType as OpenAPINodeType.Type:
return try valType.openAPINode(using: encoder)
return try valType.openAPINode()
case let valType as RawOpenAPINodeType.Type:
return try valType.rawOpenAPINode(using: encoder)
return try valType.rawOpenAPINode()
case let valType as WrappedRawOpenAPIType.Type:
return try valType.wrappedOpenAPINode(using: encoder)
return try valType.wrappedOpenAPINode()
case let valType as DoubleWrappedRawOpenAPIType.Type:
return try valType.wrappedOpenAPINode(using: encoder)
return try valType.wrappedOpenAPINode()
default:
return nil