Skip to content

dataset create web-service requires id param, docs state this is an optional param #1

@lachlanhurst

Description

@lachlanhurst

Documentation states a new dataset can be created without an id, yet calls to this webservice fail without this URL param.
https://github.com/VPAC/rsa/blob/master/doc/spatialcubeservice.md

Workaround is to include the id param in the URL with no value.
ie, make post with URL such as;

 http://localhost:8181/spatialcubeservice/Dataset.json?precision=1&dataAbstract=a&name=clientCreate1&resolution=m25&id=

Issue traced to line 108 of DatasetController. The if statement throws a null pointer exception as getId() returns null as the dataset does not exist (it can't as it is being created).

if(dr.getId().isEmpty()) {
        Dataset newDataset = new Dataset(dr.getName(), dr.getDataAbstract(), dr.getResolution(), precision);
        datasetDao.create(newDataset);
        model.addAttribute(ControllerHelper.RESPONSE_ROOT, new DatasetResponse(newDataset));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions