Merged
Conversation
added 7 commits
September 12, 2018 14:14
- Inserted/removed models don't have their structure diffed anymore, in order to prevent massive amounts of output from adding just one prop to a given model - Fixed some rendering so it's consistent across parameters and return types
Pull Request Test Coverage Report for Build 56
💛 - Coveralls |
|
Can this get merged please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the bug where cyclical references in the definitions of models would cause stack overflows as both
ModelDiff#diffandModelDiff#convert2ElPropertyswould recurse infinitely through the cycle.This is now mitigated by passing a set containing the models that have already been "visited" in the current branch of the recursion tree. If a model has already been visited, the method will short circuit, and prevent any further traversal of the cycle. If a model is either inserted or missing, its tree will not be traversed (preventing all subfields being marked as added/removed).
To test that the stack overflows are fixed, I added several cyclical references to the test swagger documents:
Pet.parentreferences#/definitions/Pet(a self-reference cycle)Pet.ownerreferences#/definitions/User, andUser.favoritereferences#/definitions/Pet, creating a cycle between the two.All tests as written still pass, and upon examination of the swagger, you can see that there are fields from
Usershowing up in the changes toPets and vice versa, eg:What's Changed
PUT/pet Update an existing petParameters
This should address the issue found in #13