swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[CPPREST][C++]Accessors for boolean fields are not given a method name starting with "is"

Open javakrieg opened this issue 9 years ago • 3 comments

Description

If you have a boolean property in a definition file (e.g. "fixed"), the Java code generator will produce a setter called "setFixed" and a getter called "isFixed". This is expected. However, the CppRest/C++ code generator will produce a setter called "setFixed" but the getter will be called "getFixed". This is incorrect. It too should be "isFixed".

Swagger-codegen version

2.2.3

Swagger declaration file content or url
  Parameter:
    type: object
    properties:
      name:
        type: string
      fixed:
        type: boolean
        description: True if the parameter cannot be changed, false otherwise.

javakrieg avatar Oct 31 '17 16:10 javakrieg

@javakrieg Can you try the latest master to see if the issue has been fixed for C++?

I remember it's fixed for Java but not sure about C++.

wing328 avatar Nov 01 '17 13:11 wing328

its not in the abstract cpp codegen, but it can be quickly added. Here is the fix: #6880

stkrwork avatar Nov 03 '17 21:11 stkrwork

@javakrieg the fix by @stkrwork has been merged into master. Please pull the latest master or use the SNAPSHOT version mentioned in the README to give it another try.

wing328 avatar Nov 04 '17 14:11 wing328