             XCTAssertNil(error)
         }
     }
-}
+
+    func testSwaggerContent() {
+        // test correct values returned from JsonApiDoc property
+        setupServerAndExpectations(router: router, expectStart: true, expectStop: true, expectFail: false)
+
+        let requestQueue = DispatchQueue(label: "Request queue")
+        requestQueue.async() {
+            Kitura.start()
+        }
+
+
+        if let jsonString = router.swaggerJSON {
+            guard let data = jsonString.data(using: String.Encoding.utf8, allowLossyConversion: false) else {
+                XCTFail("got unexpected nil from router.swaggerJSON")
+                return
+            }
+            guard let json = try? JSONSerialization.jsonObject(with: data, options: []) else {
+                XCTFail("got unexpected nil from router.swaggerJSON")
+                return
+            }
+            guard let dict = json as? [String: Any] else {
+                XCTFail("got unexpected nil from router.swaggerJSON")
+                return
+            }
+            
+            // test for paths section
+            if let paths = dict["paths"] as? [String: Any] {
+                pathAssertions(paths: paths)
+                pathContentAssertions1(paths: paths)
+                pathContentAssertions2(paths: paths)
+                pathContentAssertions3(paths: paths)
+                pathContentAssertions4(paths: paths)
+            } else {
+                XCTFail("paths is missing")
+            }
+        } else {
+            XCTFail("got unexpected nil from router.swaggerJSON")
+        }
+
+        requestQueue.async() {
+            Kitura.stop()
+        }
+
+        waitForExpectations(timeout: 10) { error in
+            XCTAssertNil(error)
+        }
+    }
+
+    func testSwaggerDefinitions() {
+        // test correct values returned from JsonApiDoc property
+        setupServerAndExpectations(router: router, expectStart: true, expectStop: true, expectFail: false)
+
+        let requestQueue = DispatchQueue(label: "Request queue")
+        requestQueue.async() {
+            Kitura.start()
+        }
+
+        if let jsonString = router.swaggerJSON {
+            guard let data = jsonString.data(using: String.Encoding.utf8, allowLossyConversion: false) else {
+                XCTFail("got unexpected nil from router.swaggerJSON")
+                return
+            }
+            guard let json = try? JSONSerialization.jsonObject(with: data, options: []) else {
+                XCTFail("got unexpected nil from router.swaggerJSON")
+                return
+            }
+            guard let dict = json as? [String: Any] else {
+                XCTFail("got unexpected nil from router.swaggerJSON")
+                return
+            }
+
+            // test for document sections
+            sectionsAssertions(dict: dict)
+
+            // test for definitions section
+            if let definitions = dict["definitions"] as? [String: Any] {
+                appleDefinitionsAssertions(definitions: definitions)
+                pearDefinitionsAssertions(definitions: definitions)
+                uglifruitDefinitionsAssertions(definitions: definitions)
+            } else {
+                XCTFail("definitions section is missing")
+            }
+        } else {
+            XCTFail("got unexpected nil from router.swaggerJSON")
+        }
+
+        requestQueue.async() {
+            Kitura.stop()
+        }
+
+        waitForExpectations(timeout: 10) { error in
+            XCTAssertNil(error)
+        }
+    }
+}


        router.put("/me/puts", handler: putSingleAppleHandlerStringId)
        router.put("/me/puti", handler: putSingleAppleHandlerIntId)

        setupServerAndExpectations(router: router, expectStart: true, expectStop: true, expectFail: false)

        let requestQueue = DispatchQueue(label: "Request queue")

            Kitura.start()
        }

        if let jsonString = router.swaggerJSON {
            guard let data = jsonString.data(using: String.Encoding.utf8, allowLossyConversion: false) else {
                XCTFail("got unexpected nil from router.swaggerJSON")
                return
            }
            guard let json = try? JSONSerialization.jsonObject(with: data, options: []) else {
                XCTFail("got unexpected nil from router.swaggerJSON")
                return
            }
            guard let dict = json as? [String: Any] else {
                XCTFail("got unexpected nil from router.swaggerJSON")
                return
            }

            // test for document sections
            sectionsAssertions(dict: dict)
        } else {
            XCTFail("got unexpected nil from router.swaggerJSON")
        }

        requestQueue.async() {
            Kitura.stop()
