{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2704","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2704/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2704/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2704/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/2704","id":151063104,"number":2704,"title":"Replace jMustache with more advanced template engine","user":{"login":"Danielku15","id":674916,"avatar_url":"https://avatars.githubusercontent.com/u/674916?v=3","gravatar_id":"","url":"https://api.github.com/users/Danielku15","html_url":"https://github.com/Danielku15","followers_url":"https://api.github.com/users/Danielku15/followers","following_url":"https://api.github.com/users/Danielku15/following{/other_user}","gists_url":"https://api.github.com/users/Danielku15/gists{/gist_id}","starred_url":"https://api.github.com/users/Danielku15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danielku15/subscriptions","organizations_url":"https://api.github.com/users/Danielku15/orgs","repos_url":"https://api.github.com/users/Danielku15/repos","events_url":"https://api.github.com/users/Danielku15/events{/privacy}","received_events_url":"https://api.github.com/users/Danielku15/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Client:%20C++","name":"Client: C++","color":"fad8c7"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Feature","name":"Feature","color":"009800"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Need%20community%20contribution","name":"Need community contribution","color":"e3ff00"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/5","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/Future","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/5/labels","id":913962,"number":5,"title":"Future","description":"","creator":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"open_issues":104,"closed_issues":50,"state":"open","created_at":"2014-12-24T05:48:44Z","updated_at":"2016-06-09T09:30:24Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2016-04-26T07:27:40Z","updated_at":"2016-06-13T09:56:04Z","closed_at":null,"body":"I am not sure if this topic was already discussed somewhen, I could not find any related topic via search. \r\n\r\nMustache advertises itself as \"Logic-less templates\" (http://mustache.github.io/) which makes it somehow hard to implement advanced code generators. You need to prepare a lot in the Java backend for type mappings etc. and even then it's some times challenging to get the behavior you'd like to have. \r\n\r\nAn example: You generate your model classes and have some dedicated JSON conversion functions for the different swagger types. There is no way to make something like: \r\n```\r\n{{#if property.type == \"string\"}}\r\n property.value = convertToString(jsonValue)\r\n{{/if}}\r\n```\r\n\r\nIn C# (ASP.net) there is a really nice template engine called Razor which translates the template into a C# class. This means you can utilize all benefits of C# within your templates. In the Java world the equivalent to Razor is Rhythm: http://rythmengine.org/doc/feature Mustache might be simple to learn and write, but I think for code generation an advanced template engine is more suitable. \r\n\r\nI would really like to see a more advanced template engine for swagger codegen to utilize all JDK functions and access all model properties as I want them to use.   \r\n\r\nI am currently working on a C++ codegenerator for our project but struggle a lot with the type conversions since complex types need different serialization than basic types or strings. "},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/225537925","html_url":"https://github.com/swagger-api/swagger-codegen/issues/2704#issuecomment-225537925","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2704","id":225537925,"user":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T09:56:04Z","updated_at":"2016-06-13T09:56:04Z","body":"Hi all,\r\n\r\nI've checked with Daniel, who has created the C++ generator in https://github.com/Danielku15/swagger-codegen-cpprestsdk and here is the latest update:\r\n\r\n> It has reached a state where API calls can be made and serialization works. There are still quite some parts missing like model validation, generating docs etc. \r\n\r\nIf anyone has cycle to plot it back to Swagger Codegen, please reply to let us know."}}
{"actor":{"display_login":"wing328"}}