Hi,
I'm trying to use swagger to create a templates for classes so that when
someone wants to write a new class into my project, he will just need to
write a json file and activate the swagger codegen.
I created a sample mustache file and a json, and the template is created
and written by swagger, BUT, instead of inserting the parameter I want it
leaves a blank space.
The example below will probably explain better.... (I am trying to create a
template for python right now):
*The mustache file: *
class {{classname}}:
def __init__(self, value):
self._value = value
def print_line(self):
if self._value > 10:
print "val bigger than 10"
else:
print "zero"
*The json file:*
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"description": "Trying to create a template class"
},
"paths": {},
"classname": "Template_Class_Example"
}
*The Result:*
class :
def __init__(self, value):
self._value = value
def print_line(self):
if self._value > 10:
print "val bigger than 10"
else:
print "zero"
As you can see, 'classname' wasn't replaced but left blank.
Am I missing something?
Is it even possible to do what I want using swagger?
Thank you in advance,
Jacob
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.