Ticket #1090 (new Defect)

Opened 3 years ago

REST API: allow ID mismatch in update-topic request

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 5.0
Component: DeepaMehta Standard Distribution Version: 4.9
Keywords: Cc: Malte, JuergeN
Complexity: 1 Area: Application Framework / API
Module: deepamehta-webservice

Description

Currently the update-topic mechanics is like this:

PUT /core/topic/<id>

with a topic model as the request data:

{
  id: ...,
  uri: "...",
  typeUri: "...",
  value: ...,
  childs: {...}
}

All parts of the topic model are optional. But IF it contains an id property and that ID differs from that one in the request path, an exception is thrown:

ID mismatch in update request

Proposed change:

That exception should not be thrown.
Instead, if IDs differ the one in the request path should have precedence. (That one in the request data is ignored then.)

This would support simple data transfer scenarios better -- GETing some topic data and PUTing them as is to another topic.

Thanks to JuergeN for bringing up this issue!

Note: See TracTickets for help on using tickets.