Skip to content
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

Unable to specify NodeLisence when creating child node (a Component) #10653

Open
hidefumi-moritani opened this issue Jun 27, 2024 · 0 comments
Open

Comments

@hidefumi-moritani
Copy link

We have detected an issue that appears to be a bug, and would like to report it below.

Steps

  1. Create a child node (component) by calling the API.
    The POST body is as follows.
{
    "data": {
        "type": "nodes",
        "attributes": {
            "category": "project",
            "title": "Project Example License 001",
            "description": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.",
            "public": false,
            "tags": [
                "license" 
            ],
            "node_license": {
                "copyright_holders": [
                    "test" 
                ],
                "year": 2023
            }
        },
        "relationships": {
            "license": {
                "data": {
                    "type": "licenses",
                    "id": "62ebb58c33eaaf0001b76f04" 
                }
            }
        }
    }
}

Note:

relationships.license does not mention Required in https://developer.osf.io/#operation/nodes_children_create, but it is assumed that specification is required.

Expected

Expect child node (a Component) to be created successfully.

Actual

The following error occurs.

 "detail": "License ID must be provided for a Node License." 

Note:

I assume the error is occurring because parsing relationships from the BODY requires JSONAPIMultipleRelationshipsParserForRegularJSON, and NodeChildrenList does not have that configured.

I think you need a parser like this.
RCOSDP@cf3809c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant