[ObjC] fix mapping generation#3894
Conversation
… Generic, but a protocol. This is what the JSONModel mapping library expects
|
What's the timeline for this? I would love to get some feedback from the other objc consumers |
|
@ClayAtWork After reading jsonmodel/jsonmodel#341, one question I've is whether this change is compatible with iOS 9 only. |
|
@wing328 No, the previous version was the one that used Objective-C generics, which are erased at compile time. This uses a Protocol, which is available to the mapping library at runtime. I'm not actually sure why this was in the generator how it was because the code did not actually compile. You cannot mix a generic and a protocol in a single declaration like the previous tests declared: |
|
Hey, can we evaluate this for being merged? Seems like an issue with the project is long term support for individual languages. Is there a single touchpoint for the Objective-C codegen? |
|
@wing328 : We are already using swagger in production on Android, and we plan on using swagger in production on both iOS and Web (through ruby) very soon. This could be a great demonstration of the power of using swagger code gen to do faster multi platform development. We published a blog post promoting the use of swagger in the past and we plan on publishing more, but we really need this to work for all clients or we will need to consider another technology, or even worse: forking this project. 😞 We love open source and would love to avoid the extreme solution of forking. Please let us know what we can do to get this PR (and hopefully more in the future) get merged! :) |
|
Hi @fabiendevos thanks for the PR. We'll get this considered based on compatibility--if it's a breaking change and causes clients to force an IOS upgrade (not saying it does!) we can always introduce a new version of the generator. PS I never saw that blog post! You should mention PPS Some of the team is right near your office and we can discuss changes faster in person... |
|
Hi @fehguy! Thanks for the quick answer. Sorry for not mentioning @SwaggerAPI when we tweeted. We will in the future. |
|
Test results look good. PR merged into master. Thanks again for the contribution. |
|
@wing328 thanks a lot for merging this! We might have more contribution to come. :) |
|
@fabiendevos thanks! Looking forward to your PRs. Btw, you may find the following useful: |
* upstream/master: [html]Group api index by operations.baseName (swagger-api#3953) Revert "[WIP] Improve PHP client emitted code quality" update retrofit1,2 samples jaxrs-cxf-cdi POM template (swagger-api#3958) [Swift] Add / as enum separator issue-890 correct fix for deprecated Jersey method 2208 fix Objc Mapping Generation (swagger-api#3894) [Spring] Format datetime in rfc3339 (swagger-api#3777) [Java/Jackson] use a jdk6 compatible DateFormat for java.util.Date (swagger-api#3768) add template owner jax-rs cxf cdi remove newline char in *.mustache; added generated code Add a new JAX-RS server generator - jaxrs-cxf-cdi (swagger-api#3940) added package paths for retrofit class names feature(PHP QA) add initial PHP client template tweaks to improve emitted code quality [resteasy] configure jackson to use rfc3339 dates [jersey] configure jackson to use rfc3339 dates
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
fixes #2208
Fixes Objective-C generation of maps via additionalProperties, to create a string-to-object map. The JSON Mapping library used by the generated code, JSONModel, see jsonmodel/jsonmodel#341