swagger-api / swagger-api/swagger-codegen

[Swift4] Interoperability with Objective C

Open
#6,763 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Swift Enhancement: Compatibility help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

We're looking to use Swagger codegen with SWG v3.0 to generate the model and api files. However, we need to use these with existing Objective C project eg. Need the model obejcts returned in the response to be stored in local model to be used with ObjC View controllers.

Swagger-codegen version

verion 2.2.3

Swagger declaration file content or url

any file will do. Nothing specific

Command line used for generation

plain generate commanf for -l swift4

Steps to reproduce

generate any SWG v3.0 file into swift classes

Related issues/PRs
Suggest a fix/enhancement

Along with declaring Codeable, which you already do, the model objects need to be subclassed from NSObject, have @objcMembers annotation etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the plain generator command with -l swift4 on any Swagger v3.0 definition and inspect the generated model and API Swift files. Check how the Swift4 templates represent Codable models, then verify the generated models support Objective-C use through NSObject inheritance and @objcMembers. Done means the generated models can be stored and used by existing Objective-C view controllers.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, swift
Domain
mobile-dev, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.