Description
Generated objective-c code uses old JSONModel library method for init, which is deprecated.
SwaggerClient/Model/SWGSearchModel.m:20:33: 'initWithDictionary:' is deprecated: use initWithModelToJSONDictionary:
Swagger-codegen version
2.2.1
Swagger declaration file content or url
swagger: '2.0'
info:
version: "1"
title: "Hello warning"
basePath : "/api/v1"
produces:
- application/json
schemes:
- https
paths:
/categories:
get:
description: get categories
responses:
200:
description: Successful response
schema:
type: array
items:
$ref: '#/definitions/UserSkill'
definitions:
Category:
description: Some category for user
type: object
properties:
id:
type: integer
format: int64
alias:
type: string
localized_name:
type: string
UserSkill:
description: User skill description based on category
allOf:
- $ref: '#/definitions/Category'
- properties:
year_started:
description: Year since user has that skill
type: integer
Command line used for generation
swagger-codegen generate -i ./swagger.yaml -l objc -o ./SwaggerClient
Steps to reproduce
- Generate code
- Create a test project, create Podfile with contents:
use_frameworks!
platform :ios, '9.0'
target 'TestSwagger' do
pod 'SwaggerClient', :path => './SwaggerClient'
end
- Run
pod install
- Build project
Suggest a Fix
Use a suggested method initWithModelToJSONDictionary
Description
Generated objective-c code uses old JSONModel library method for init, which is deprecated.
Swagger-codegen version
2.2.1
Swagger declaration file content or url
Command line used for generation
swagger-codegen generate -i ./swagger.yaml -l objc -o ./SwaggerClientSteps to reproduce
pod installSuggest a Fix
Use a suggested method initWithModelToJSONDictionary