swagger-api/swagger-codegen

Swagger codegen generates a nullable integer as method return value in SDK for operation that returns an integer

開放

#6,872 建立於 2017年11月2日

 (8 則留言) (1 個反應) (0 位負責人)HTML (5,474 個分叉)batch import
Client: C-SharpEnhancement: GeneralGeneral: Questionhelp wanted

倉庫指標

星標
 (12,701 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Description

I have an operation which returns an integer, and when I generate a C# SDK using codegen, the method associated with the operation returns a nullable integer instead of an integer. I tried to set the produced response schema as required using an operation filter and setting the default value as 0 but it had no effect.

Here is the definition of my operation responses:

       "responses":{  
           "200":{  
              "description":"Success",
              "schema":{  
                 "format":"int32",
                 "default":0,
                 "required":[  
                    "200"
                 ],
                 "type":"integer"
              }
           }
        }

Thank you for any insight

貢獻者指南