-
-
Notifications
You must be signed in to change notification settings - Fork 228
Feature/add-properties-local-reference-support #329
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
Feature/add-properties-local-reference-support #329
Conversation
Codecov Report
@@ Coverage Diff @@
## main #329 +/- ##
===========================================
- Coverage 100.00% 99.93% -0.07%
===========================================
Files 47 47
Lines 1410 1549 +139
===========================================
+ Hits 1410 1548 +138
- Misses 0 1 +1
Continue to review full report at Codecov.
|
de29192
to
87c5b12
Compare
I started working on fixing #338 on this branch, wip |
dbd4e60
to
81a5e56
Compare
…eference properties
81a5e56
to
ce6bb1e
Compare
905ffd4
to
3d076ba
Compare
… string for typing
c5da86c
to
b46348d
Compare
… `false` - Having nullable to `true` lead to invalid source generation Since `LazyReferencePropertyProxy` is only made to be used for inner property reference, it seems unamrfull It's ~nullability shall be define on its parent
b46348d
to
d0a2e6e
Compare
I've added the support for the resolution of inner property direct and indirect reference to its parent model. It resolve #338 The PR is ready for review @sp-schoen @emann |
@p1-ra This solves my bug, but it seems like a new one was introduced. Now I get the error |
Your issue seem to come from the string sanitizer function used to generate python friendly class name:
|
Sorry I haven't gotten around to giving feedback on this yet. There are some other problems with references that need to be solved as well and I think the ultimate solution will end up being related. Having just glanced through this code (so I may very well be missing something) I don't think we need lazy/late resolution to solve it. Similar to my findings in #312, there is a top level loop which will keep running and attempting to parse previously failed properties until it gets stuck. So when attempting to construct a model, if there's a reference that doesn't exist yet, it'll fail then but get retried later when, presumably, the reference has been registered. I also successfully managed to remove most globals earlier in this project and would like to keep it that way since they have a nasty way of causing unexpected issues. Globals and exceptions 😅. Anyway, my point is just that I haven't forgotten this issue & PR, but I think I need to do some bigger refactors & fixes related to references which will probably include fixing this elsewhere. |
The two issues are solved by #366 , I'm closing this PR, thanks! |
I'm re-opening it for tracking purpose. Looks I've mess up with my tests (Oopsy!) #366 do not resolve it. |
I'm going to close this just because it's pretty far behind main. We obviously want complete reference support at some point but I doubt this PR will be the end solution (I think a couple other related ones have come through since?) |
Title
Feature/add-properties-local-reference-support
Description
This PR aims to bring support of properties local references resolution. It could happen that in a Document a local reference is pointing to one or multiple other virtual references instead to its property definition, as for exemple:
During properties parsing, those virtual reference are resolved by making them pointing to their target
ModelProperty
orEnumProperty
definition.Thus, only the target model will be generated and any path referencing them (the virtual reference) will use the target model.
Also add support for inner property direct and indirect reference to its parent model resolution, as:
QA Notes & Product impact
Add support for properties local reference ($ref) resolution
Add support for inner property direct and indirect reference to its parent model resolution.
@dbanty