swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.01k stars 6.03k forks source link

[SWIFT] No README.md file generated for Swift Client #3088

Open dylan-colaco opened 8 years ago

dylan-colaco commented 8 years ago
Description

I used swagger-codegen from a web-api but I don't get a readme file for SWIFT. I am not sure exactly which objects have to be used/configured and in what order. Is there any guide for this? If I generate for Objective-C or some other languages, there is a readme file generated that explains this...

Swagger-codegen version

swagger code generated from website

Swagger declaration file content or url
Command line used for generation
Steps to reproduce

Generate Swift Client Files

Related issues
Suggest a Fix

Generate a readme file explaining how to configure & use the swift objects

wing328 commented 8 years ago

Agreed that a README will be helpful. For ObjC API client, we provide README and documentation (markdown) for API endpoints and models. Here is an example: https://github.com/wing328/petstore-objc We can reference ObjC API client to do something similar for Swift API client.

cc @jaz-ah @Edubits

jaz-ah commented 8 years ago

yup no problem - in the meantime @dylan-colaco you can look at the example code to help you get started...

dylan-colaco commented 8 years ago

Sure. I've managed to figure some stuff out by reading through the generated code, though with documentation things would have gone much faster!

jaz-ah commented 8 years ago

completely agree. I can try to get that going this weekend.

dylan-colaco commented 8 years ago

I know that stackoverflow is the actual place for such problems, but I thought you guys would be able to help better. I understood how to get an object of a model using API classes that internally make get requests. However, one of my Models goes not have an API Class (that's the way this swagger API was designed), but instead sends the configuration of the model as payload in a push notification.

Basically I wanted to know how to instantiate a model from received JSON(deserialised) data manually, without using an API class. I could do an init() and manually set each variable, but I presume there's a better way?

benblechman commented 2 years ago

I just ran into this with a more recent build of codegen. It looks to me like there is a mustache template for the README.md, but it's not included in the supportingFiles added in the https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift5Codegen.java. Anybody working on this?