Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #1232 Enum revivers and unused imports #1238

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

cpaulve-1A
Copy link
Contributor

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

@cpaulve-1A cpaulve-1A requested a review from a team as a code owner January 17, 2024 08:40
@github-actions github-actions bot added bug Something isn't working project:@ama-sdk/schematics labels Jan 17, 2024
Copy link

nx-cloud bot commented Jan 17, 2024

☁️ Nx Cloud Report

We didn't find any information for the current pull request with the commit 22f47a6.
Please verify you are running the latest version of the NxCloud runner.

Check the Nx Cloud Source Control Integration documentation for more information.

Alternatively, you can contact us at cloud-support@nrwl.io.


Sent with 💌 from NxCloud.

To avoid references to revivers of non object models in the reviveModel, the generator checks the nonObjectDefinition vendor of the property

As a reviver should revive both its properties and the ones inherited from the parents,

it is based on the allVars property which was forgotten prior to this PR

An additional fix cleans the unused import
@cpaulve-1A cpaulve-1A force-pushed the fix/1232-enum-and-useless-import branch from 2ed2b21 to 22f47a6 Compare January 18, 2024 08:45
@cpaulve-1A cpaulve-1A merged commit c748dde into release/9.5 Jan 18, 2024
22 checks passed
@cpaulve-1A cpaulve-1A deleted the fix/1232-enum-and-useless-import branch January 18, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working project:@ama-sdk/schematics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants