     func registerRoute<I: Codable, O: Codable>(route: String, method: String, inputType: I.Type, outputType: O.Type, responseTypes: [SwaggerResponseType]) {
         Log.debug("Registering \(route) for \(method) method")
 
-        let typeInfo: TypeInfo
+        let inputTypeInfo: TypeInfo
         do {
-            typeInfo = try TypeDecoder.decode(outputType)
+            inputTypeInfo = try TypeDecoder.decode(inputType)
         } catch {
-            Log.debug("type decode error")
+            Log.debug("Failed to decode input type \(inputType)")
             return
+        }
+
+        var outputTypeInfo: TypeInfo? = nil
+        if inputType != outputType {
+            do {
+                outputTypeInfo = try TypeDecoder.decode(outputType)
+            } catch {
+                Log.debug("Failed to decode output type \(outputType)")
+                return
+            }
         }
 
         // insert the path information into the document structure.
         swagger.addPath(path: route, method: method, id: nil, qParams: nil, inputType: "\(inputType)", responseList: responseTypes)
 
         // add model information into the document structure.
-        swagger.addModel(model: typeInfo)
+        swagger.addModel(model: inputTypeInfo)
+        if let outputTypeInfo = outputTypeInfo {
+            swagger.addModel(model: outputTypeInfo)
+        }
 
         // now walk all the unprocessed models and ensure they are processed.
         for unprocessed in Array(swagger.unprocessedTypes) {

    func registerRoute<Id: Identifier, I: Codable, O: Codable>(route: String, method: String, id: Id.Type, inputType: I.Type, outputType: O.Type, responseTypes: [SwaggerResponseType]) {
        Log.debug("Registering \(route) for \(method) method")

        let typeInfo1: TypeInfo
        do {
            typeInfo1 = try TypeDecoder.decode(inputType)
        } catch {
            Log.debug("failed to decode input type")
            return
        }

        var typeInfo2: TypeInfo? = nil
        if inputType != outputType {
            do {
                typeInfo2 = try TypeDecoder.decode(outputType)
            } catch {
                Log.debug("failed to decode output type")
                return
            }
        }

            let model = String(describing: name)
            var modelDefinition: SwaggerModel

            // Check to see if we have already built this model
            guard self.definitions[model] == nil else {
                Log.debug("Already generated model \(model)")
                return
            }

            // then build all it
            if let modelInfo = try? buildModel(typeInfo) {
                Log.debug("in addModel(model: \(model))")
