     func translate(type: ModelParser.FieldType, name: String) -> String {
         let (parsers, instructions, typeName) = createParsers(type, parentTypeNames: [name], valueExpression: "jsonValue")
         
-        let declarations = parsers.sort { $0.0.priority > $0.1.priority }.lazy.map { $0.text }.joinWithSeparator("\n\n")
+        let declarations = parsers.sort {
+            if $0.0.priority > $0.1.priority {
+                return true
+            } else if $0.0.priority == $0.1.priority {
+                return $0.0.text < $0.1.text
+            }
+            return false
+        }.lazy.map { $0.text }.joinWithSeparator("\n\n")
         let parseFunction = [
             "",
             "",

        if let decl = decl {
            return decl
        }
        return "typealias \(name) = \(typeName)"
    }
    
    private func makeSubtype(type: ModelParser.FieldType, name: String, subName: String, level: Int) -> (name: String, declaration: String?) {

    case ContiguousArray
}

private enum Visibility: String {
    case Internal = "internal"
    case Public = "public"
    case Private = "private"
}

extension Visibility {
    var visibilityPrefix: String {
        return self == .Internal ? "" : "\(self.rawValue) "
    }
}

class SwiftModelCreator: ModelTranslator {
    
    private let objectType: ObjectType
    private let listType: ListType
    private let fieldVisibility: Visibility
    private let typeVisibility: Visibility
    private let mutableFields: Bool
    
    required init(args: [String] = []) {
        self.objectType = args.contains("-c") || args.contains("--class") ? .Class : .Struct
        self.listType = args.contains("-ca") || args.contains("--contiguousarray") ? .ContiguousArray : .Array
        self.mutableFields = args.contains("-m") || args.contains("--mutable") ? true : false
        self.fieldVisibility = args.contains("-pf") || args.contains("--publicfields") ? .Public : .Internal
        self.typeVisibility = args.contains("-pt") || args.contains("--publictypes") ? .Public : .Internal
    }
    
    func translate(type: ModelParser.FieldType, name: String) -> String {
