Skip to content

Latest commit

 

History

History

test-ios

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SwaggerClient

个人测试空间 Mock 专用

This ObjC package is automatically generated by the Swagger Codegen project:

  • API version: last
  • Package version:
  • Build package: io.swagger.codegen.languages.ObjcClientCodegen

Requirements

The SDK requires ARC (Automatic Reference Counting) to be enabled in the Xcode project.

Installation & Usage

Install from Github using CocoaPods

Add the following to the Podfile:

pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

To specify a particular branch, append , :branch => 'branch-name-here'

To specify a particular commit, append , :commit => '11aa22'

Install from local path using CocoaPods

Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile:

pod 'SwaggerClient', :path => 'Vendor/SwaggerClient'

Usage

Import the following:

#import <SwaggerClient/SWGApiClient.h>
#import <SwaggerClient/SWGDefaultConfiguration.h>
// load models
#import <SwaggerClient/SWGEmptyObject.h>
#import <SwaggerClient/SWGInlineResponse200.h>
#import <SwaggerClient/SWGInlineResponse200TestParam2.h>
// load API classes for accessing endpoints
#import <SwaggerClient/SWGApi.h>

Recommendation

It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues.

Getting Started

Please follow the installation procedure and then run the following:

NSString* *param1 = @"param1_example"; // testing params

SWGApi *apiInstance = [[SWGApi alloc] init];

// test_mock_1_basic
[apiInstance mockGetWithParam1:param1
              completionHandler: ^(SWGInlineResponse200* output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];

Documentation for API Endpoints

All URIs are relative to http://localhost/samuel_test

Class Method HTTP request Description
SWGApi mockGet GET /mock test_mock_1_basic
SWGApi mockWithMockjsGet GET /mock/with/mockjs test_mock_2_mockjs

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author