CocoaPods trunk is moving to be read-only. Read more on the blog, there are 11 months to go.

SwaggerAutomocker 0.2.1

SwaggerAutomocker 0.2.1

Maintained by lngyeen.



 
Depends on:
Telegraph~> 0.28.0
ObjectMapper~> 4.1.0
Fakery~> 5.1.0
 

  • By
  • lngyeen

SwaggerAutomocker

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

SwaggerAutomocker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SwaggerAutomocker'

Usage

Configure App Transport Security: Because the purpose of this mock server is only for mock environment, our server only supports http protocol, so to be able to run the mock server you need to disable App Transport Security by adding the key App Transport Security Settings to your Info.plist, with a sub-key where Allow Arbitrary Loads is set to Yes.

Start mock server:

var mockServer: MockServer?

let swaggerJson = readJSONFromFile(fileName: "swagger")
if let swaggerJson = swaggerJson {
    mockServer = MockServer(port: 8080, swaggerJson: swaggerJson)
    mockServer?.start()
}

Stop mock server when app is send to the background mode:

mockServer?.stop()

Restart mock server when the app returns to the active mode:

mockServer?.start()

Author

lngyeen, [email protected]

License

SwaggerAutomocker is available under the MIT license. See the LICENSE file for more info.