Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Can only call addModels once in swagger.js #22

Closed
rjohn opened this issue Dec 7, 2012 · 1 comment
Closed

Can only call addModels once in swagger.js #22

rjohn opened this issue Dec 7, 2012 · 1 comment

Comments

@rjohn
Copy link

rjohn commented Dec 7, 2012

Hi,

I modified the addModels function in the swagger.js file to the following. This allows the separation of models into more than one file.

It appends to, rather than replaces, the models collection in swagger.js.

// adds models to swagger
function addModels(models) {
if(!allModels['models']) {
allModels = models;
} else {
for(k in models['models']) {
allModels['models'][k] = models['models'][k];
}
}
return this;
}

This lets me organize my code a little better, and the models.js file does not get out of hand.

Not sure it is an issue really, but just thought I would put it out there as an idea.

Rich

@fehguy
Copy link
Contributor

fehguy commented Jan 3, 2013

Hi @rjohn yes, makes is a lot more usable.

@fehguy fehguy closed this as completed Jan 3, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants