[MGNLREST-160] Implement: Moving reference resolver to NodeWriter Created: 11/Dec/17  Updated: 09/Mar/18  Resolved: 26/Feb/18

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1

Type: Improvement Priority: Neutral
Reporter: Sang Ngo Huu Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 0
Labels: rest
Remaining Estimate: 1h
Time Spent: 16.75d
Original Estimate: 3d

Attachments: PNG File output.png     PNG File self-reference-case.png    
Issue Links:
Cloners
dependency
depends upon MGNLREST-119 Research solution for resolving resul... Closed
is depended upon by MGNLREST-107 Resolve references as links Closed
relation
is related to MGNLREST-174 Duplicated UUIDs should be resolved c... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Epic Link: REST Phase2
Sprint: Saigon 126, Saigon 127, Saigon 128, Saigon 129, Saigon 130, Saigon 131, Saigon 132, Saigon 133, Saigon 134, Saigon 135, Saigon 136
Story Points: 5

 Description   

After discussed, we agreed new approach as bellow:

  • Create simple expander by using Decorator/Wrapper to resolve item to canonical format: [provider]:[workspace]:[uuid] (see DEV-649 for more details). Then resolve that id in NodeWriter.
  • Register the ComponentProvider to RestDispatchServlet, then inject it by @Context in NodeWriter, then get resolver by provider in resolving canonical format.

Once this is done, if reference expansion becomes automatic (for the new canonical format for example), then we will have to think about how to enable/disable reference expansion per endpoint. But we don't have to think about this for now, since all expansions have to be configured.



 Comments   
Comment by Oanh Thai Hoang [ 01/Mar/18 ]

I encounter 1 Self Reference case

Say, you have 1 tour reference to a list of tour and 2 of referenced tour are himself

Eg:

Output:

Should we resolve 3 of them as well?

Comment by Oanh Thai Hoang [ 02/Mar/18 ]

I created MGNLREST-174 as trivival improvement of duplicated case as above comment and closed this ticket

Comment by Sang Ngo Huu [ 02/Mar/18 ]

I'm not sure your case is make sense. But I agree that it should resolve instead of showing uuid only

Generated at Mon Feb 12 06:57:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.