KituraOpenAPI
public class KituraOpenAPIKituraOpenAPI contains helper functions for the addition of endpoints to a Kitura Router
for serving:
- an OpenAPI definition of its routes and their associated data types,
- the SwaggerUI tool, that allows exploration and testing of the API via a web browser.
Usage Example:
import Kitura
import KituraOpenAPI
let router = Router()
KituraOpenAPI.addEndpoints(to: router)   // Register default endpoints
The endpoints have default values defined by the defaultConfig property. You can customize
the endpoints by supplying a KituraOpenAPIConfig:
let config = KituraOpenAPIConfig(apiPath: "/swagger", swaggerUIPath: "/swagger/ui")
KituraOpenAPI.addEndpoints(to: router, with: config)
- 
                  
                  The default endpoints registered by KituraOpenAPI.addEndpointsto serve the OpenAPI definition and the SwaggerUI tool. These values are/openapiandopenapi/ui, respectively.DeclarationSwift public static var defaultConfig: KituraOpenAPIConfig
- 
                  
                  Add endpoints to a Kitura Router, to serve the OpenAPI document and SwaggerUI.DeclarationSwift public static func addEndpoints(to router: Router, with config: KituraOpenAPIConfig = KituraOpenAPI.defaultConfig)ParametersrouterThe Routerwhose routes should be described.configOptionally specify the paths to register. If not specified, the values described in defaultConfigwill be used.
- 
                  
                  Write Kitura’s OpenAPI definition to a file, describing all Codable routes that have been registered with the given Router.Throws NSError if the file cannot be written.DeclarationSwift public static func writeOpenAPI(from router: Router, to filePath: String) throwsParametersrouterThe Router whose routes should be described. filePathThe path to a file that should be written. 
 View on GitHub
            View on GitHub
           KituraOpenAPI Class Reference
      KituraOpenAPI Class Reference