krakenjs / generator-swaggerize

Yeoman generator for design-driven apis with swagger 2.0 and krakenjs/swaggerize tools.
Other
70 stars 34 forks source link

Skip the model generation for type array #75

Closed subeeshcbabu-zz closed 8 years ago

subeeshcbabu-zz commented 8 years ago
tlivings commented 8 years ago

Why not just resolve $ref for items?

subeeshcbabu-zz commented 8 years ago

I don't think there is much value in generating a model file for an array type.

Say for the petstore example, a model file gets generated for Pet.

Pet: {
required: [
"id",
"name"
],
properties: {
id: {
type: "integer",
format: "int64"
},
name: {
type: "string"
},
tag: {
type: "string"
}
}
}

For the array type, Pets, the model file, is just going to be an array list of the already generated model Pet. Do we need to generate a file for this?

Pets: {
type: "array",
items: {
$ref: "#/definitions/Pet"
}
},
tlivings commented 8 years ago

Oh yeah right, totally. I spoke too fast.