[MGNLREST-343] Empty node name when using illegal characters Created: 20/Sep/21  Updated: 07/Jun/22  Resolved: 25/Jan/22

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

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Javier Benito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
causes MGNLREST-349 Creating asset via rest is not possib... Closed
is caused by PAGES-557 Empty node name when using illegal ch... Closed
causality
relation
is related to MGNLREST-359 Cannot put nodes with colons in the name Closed
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
Date of First Response:
Sprint: DevX 1, DevX 2
Story Points: 5

 Description   

Steps to reproduce

  1.  Use the nodes endpoint to create a node name <test>
    curl http://localhost:8080/magnoliaAuthor/.rest/nodes/v1/website/travel \
    -H "Content-Type: application/json" \
    -X PUT -i \
    --user superuser:superuser \
    --data \
    '{
      "name": "<test>",
      "type": "mgnl:page",
      "path": "/travel/<test>",
      "properties": [
        {
          "name": "title",
          "type": "String",
          "multiple": false,
          "values": [
            "Hello REST"
          ]
        },
        {
          "name": "mgnl:template",
          "type": "String",
          "multiple": false,
          "values": [
            "travel-demo:pages/standard"
          ]
        }
       ]
    }'

Expected results

Either node with name <test> is created/illegal chars are replaced or an error is thrown informing about the wrong name

Actual results

A node with empty name is created

Development notes

info.magnolia.rest.service.node.v1.NodeEndpoint.createNode(String, String, RepositoryNode) could check and validate the passed name and let the user know if the name is not valid.



 Comments   
Comment by Richard Gange [ 12/Apr/22 ]

This change is causing MGNLREST-359

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