servicecatalog / oscm-rest-api

An RESTful API for the OSCM Platform.
https://openservicecatalogmanager.org
Apache License 2.0
2 stars 1 forks source link

Reimplement Setting#POST endpoint #89

Open adamczykba opened 5 years ago

adamczykba commented 5 years ago

Describe the bug POST endpoint in SettingsResource aside from creating new records also overwrites existing ones. There should be some check for duplicates.

To Reproduce Steps to reproduce the behavior:

  1. Create new Setting through REST request
  2. Send the same request second time (optionally try to change some value to see the change)
  3. Go to Settings table in DB and see that record has been changed

Expected behavior POST endpoint should only create new records. It should not be able to update them.

Observed behavior SettingsResource#POST request overwrites existing settings records

Screenshots N/A

Additional context N/A

Crystalzord commented 4 years ago

I already commented on this here: https://github.com/servicecatalog/oscm-rest-api/issues/164 The implementation of saveConfigurationSetting method from OperatorServiceBean class in the oscm repository and the ConfigurationKey class from oscm-interfaces need refactoring in order to make the POST endpoint work correctly.

I edited the task name.