fix: #1232 Enum revivers and unused imports #1238
Merged
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.
Context
To avoid reviving non object models in the revivers, the generator checks the nonObjectDefinition vendor of the property. This means that the property is based on a model which is not an object and therefore cannot be revive, the revival will be skipped.
As a reviver should handle both the model properties and the ones inherited from the parents, it is based on the allVars property which was forgotten prior to this PR.
Today, we do not add the correct vendor on the allVar property used in the templates but rely on the isEnumRef and isEnum property of the models. Unfortunately, they are false in case of Maps and Arrays.
Proposed change
Add nonObjectModel vendor to the allVars properties and remove the logic to detect enum within Map and Array as it is faulty.
An additional fix cleans the unused import to avoid any reference to unused or non-existant models
Related issues