Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-146355

No validation when creating a relationship via API

    Description

     Description

    No validation when creating a relationship via API

     Steps to Reproduce

    1. Log in to the Portal as an admin
    2. Go to http://localhost:8080/o/api?endpoint=http://localhost:8080/o/object-admin/v1.0/openapi.json
    3. Go to postObjectDefinitionObjectRelationship
    4. Set the value of objectDefinitionId to a custom object definition ID
    5. Set the Request body to (change the objectDefinitionId1 and objectDefinitionId2):
    {
      "deletionType": "cascade",
      "label": {
        "en_US": "Relationship Test"
      },
      "name": "relationshipTest",
      "objectDefinitionId1": same ID from above,
      "objectDefinitionId2": native object definition ID,
      "type": "oneToMany"
    }

     Expected Result
    The relationship is not created

     Actual Result
    The relationship is created even though it is not possible to create a OneToMany relationship with a native object (N-side) via UI

    Obs.: Same happens when trying to create a One to One relationship.

     Reproduced In:
    master: 29e67c44d338be860c2c25a0715ec37b6a2436df

      Attachments

        Issue Links

          Activity

            People

            Assignee:
            marcela.cunha Marcela Cunha
            Reporter:
            carolina.barbosa Carolina Barbosa
            Participants of an Issue:
            Recent user:
            Felipe Lins
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              17 weeks, 5 days ago

                Packages

                Version Package