swagger-api/swagger-codegen

[Swift] responses: schema: type: object --> RequestBuilder<Inline_response_200> ?

Open

#2.093 geöffnet am 10. Feb. 2016

Auf GitHub ansehen
 (31 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)HTML (5.474 Forks)batch import
Client: SwiftEnhancement: Generalhelp wanted

Repository-Metriken

Stars
 (12.701 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

When I feed an API with the following responses definition:

      responses:
        '200':
          description: Request was successful
          schema:
            type: object

the codegen generates something like the following client-side code:

public class func usercount(Swaggerwhere Swaggerwhere: String?) -> RequestBuilder<Inline_response_200> {

where I don't understand how to handle the returned object value...? I would expect an plain object is mapped to a dictionary so that access key-value pairs can be read... Would you kindly tell me if I'm mistaking something?

When I tried Obj-C and it also behaves in a similar manner:

-(NSNumber*) userCountWithCompletionBlock :(NSString*) where
    completionHandler: (void (^)(XXInlineResponse200* output, NSError* error))completionBlock;

So, there might be some design decision already discussed and it has been decided to generate Inline_response_200 thing for object response type. But I still don't see how to handle the returned object. Any help would be much appreciated! (@bajtos wanted to keep informed about this too)

Contributor Guide