Closed macisamuele closed 5 years ago
There are no specific performance differences as:
is_object
is used during model discovery and to get the validation flow started.
The most critical path is in the validation flow, but it is used only to have the flow started (so one extra check that is used once)is_model
is used only for doc-string generation, so no real performance hit
While testing the library, I've played a bit importint the kubernetes swagger specs (link). The specs were selected as a good example of very very big swagger specs. During the testing I've uncovered an issue related to
is_models
andis_object
methods.The method do assume that
x-model
andtitle
properties of the object are string, but this is not something that we could actually assume as the specs do not prevent the presence of the attribute as valid object properties. For exampleThe goal of this PR is to better handle the condition of:
x-model
is not astring
title
is not astring
In order to prevent future regression I extracted a small test-case that is able to trigger the issue.
The script using while testing (that helped me discovering the bug) is the one listed below