Skip to content

Commit

Permalink
Correção paliativa de referência circular na especificação do Model
Browse files Browse the repository at this point in the history
  • Loading branch information
edivergis committed Dec 6, 2019
1 parent 9232e1a commit 9f16d92
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flask_restplus/swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ def register_model(self, model):
name = model.name if isinstance(model, ModelBase) else model
if name not in self.api.models:
raise ValueError('Model {0} not registered'.format(name))
if name in self._registered_models:
return ref(model)
specs = self.api.models[name]
self._registered_models[name] = specs
if isinstance(specs, ModelBase):
Expand Down

0 comments on commit 9f16d92

Please sign in to comment.