[MGNLREST-760] AdditionNodeWrapper should override getProperty method Created: 09/Oct/23  Updated: 13/Dec/23  Resolved: 29/Nov/23

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.0, 2.2.24

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Canh Nguyen
Resolution: Fixed Votes: 1
Labels: None
Σ Remaining Estimate: 0d Remaining Estimate: 0d
Σ Time Spent: 3d Time Spent: 3d
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File Captura de pantalla 2023-10-09 a las 12.26.44.png     PNG File Captura de pantalla 2023-10-09 a las 12.27.03.png     Zip Archive my-company.zip     Zip Archive my-light-module.zip    
Issue Links:
Problem/Incident
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLREST-771 Implement Sub-task Completed Canh Nguyen  
MGNLREST-772 Review Sub-task Completed Chuong Doan Huy  
MGNLREST-773 piQA Sub-task Completed Chuong Doan Huy  
MGNLREST-774 QA Sub-task Closed Anh Vu  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: Support
Sprint: DevX 51
Story Points: 3
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

Description

The AdditionNodeWrapper overrides the getProperties method, which allows the user to iterate over the additionalProperties of the node. But the getProperty method is not overwritten, so when for a property which is stored at additionalProperties (e.g, when we create a link from a page to another page, there is a @link property stored within the referenced page) it can only be accessed through the getProperties method because the getProperty (super class) doesn't look within the additionalProperties attribute.

Steps to reproduce

  1. Go to Pages-app
  2. Create a page (lets call it siteOne)
  3. Create another page (lets call it siteTwo)
  4. Now open the siteOne page and within the main area create a link component
  5. Link to the siteTwo page
  6. Register the endpoint definition (just copy the light module)
  7. Install the attached module which as a custom Reference Resolver
  8. Call the endpoint http://localhost:8080/magnoliaAuthor/.rest/delivery/my-endpoint
  9. Check the getProperty method for @link attribute returns false but the node.getProperties("@link") works

Expected results

The getProperty method should return true when the attribute @link is checked

Development notes

Override the getProperty method so it also checks within the additionalAttributes list


Generated at Mon Feb 12 07:02:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.