Enhancing spec flattening done in #324 (released with bravado-core==5.12.0) did introduce a bug that caused models referenced by discriminated models to not be included in the final spec flattening.
A minimal use-case has been extracted in test-data/2.0/models_referenced_by_polymorphic_models/.
The basic bug was related to the fact that register_unflattened_models relied on a gobal variable for the flattened_models which was not properly updated after the model discovery.
In order to fix this issue I've made sure that the determination of the already flattened models is done in the register_unflattened_models context
Coverage remained the same at 98.89% when pulling 32d3b0bd2eee5561de28d9d0fd30133265a0f1b4 on macisamuele:maci-fix-model-discovery-during-flattening into a483090eac1a591bd5713abe3ef2107c5cb92cf7 on Yelp:master.
Enhancing spec flattening done in #324 (released with bravado-core==5.12.0) did introduce a bug that caused models referenced by discriminated models to not be included in the final spec flattening.
A minimal use-case has been extracted in
test-data/2.0/models_referenced_by_polymorphic_models/
. The basic bug was related to the fact thatregister_unflattened_models
relied on a gobal variable for theflattened_models
which was not properly updated after the model discovery.In order to fix this issue I've made sure that the determination of the already flattened models is done in the
register_unflattened_models
context