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

[C++] [Restbed] Improvement ideas

Open stkrwork opened this issue 9 years ago • 2 comments

  • [x] Fix class names for resources
  • [ ] Parsing to/from json for maps
  • [ ] Check for Parsing to/from for lists
  • [ ] Add to/fromXml functions for models

Just some ideas I have for the restbed generator. Will try to look into those very soon.

stkrwork avatar Jun 23 '17 21:06 stkrwork

I have started work on the first point on the list the class names.

In the current version it takes the operation id of the first method for a specific path and transforms it to {{operationId}}Resource for the class name of a resource identifying calls to a specific path.

In the new version I am currently working on, it will take the path itself, for example pet/{petid} and create a vendor extension called x-codegen-resource-name, or a similar name, which will contain the path sanitized. In this example it would be petPetId, which would result in petPetIdResource as the class name, which makes it easier to understand what the purpose of the class is.

stkrwork avatar Jul 08 '17 23:07 stkrwork

#6017 is the pr for the first item on the list of improvements

stkrwork avatar Jul 09 '17 22:07 stkrwork