Open pcads opened 8 years ago
@pcads I don't think the nodejs server stub generator supports the feature you mentioned and we welcome contribution to make the improvement.
The msutache template for nodejs
is a good starting point:
I am not familiar with mustache. I will take a look and hopefully I could do something. Thanks
My apologies. In the nodejs
template, I did find the use of {{examples}} mustache tag:
service.mustache: {{#examples}}examples['{{contentType}}'] = {{{example}}};
service.mustache: {{/examples}}
Can you try starting the nodejs server with the following command instead?
NODE_ENV=development node index
I tried with NODE_ENV=development node index, still doesn't work.
Yeah I don't think using the example data is in the node template. I was using it earlier and the controllers serve up dummy data that contains the likes of {"userName": "aeiou"}
Not sure if this is by design or bug. I have example for every object under definitions section. When I use codegen to generate a nodejs server, I am hoping at least the response body for GET should use the example data, but it doesn't.
Example data shows up under "Response Class", but when I click "Try it out!", in stead of example data, I get generic json object generated by Codegen using the schema. Like {"userName": "aeiou"}
Do I miss anything? Thanks