Wrong field name fed by API breaks Datagerry


I’ve been playing with API and mistyped “name” as “mame” while creating a new object after which Datagerry stopped working and gave me a connection page.

Example bad request

curl -kX POST -d ‘{“author_id”: 1, “type_id”: 1, “fields”: [{“name”: “hostname”, “value”: “test-rhel7”}, {“mame”: “ip”, “value”: “”}]}’ -H “Content-Type: application/json” -v -u admin:admin

In the logs it says

KeyError: ‘name’

For now I just deleted wrong entry from mongodb, but it would be nice to have some protection from such mistakes.

Hello @omicron and welcome to our community,

thank you for your feedback. We will add this to our backlog.

In this POST you will find examples of how to create types, objects, categories via Rest and which properties (validation of incoming data is done via Ceberus 1) are required.

With best regards

Thank you.

I also noticed that API lets you to create an object without providing all the necessary fields (marked as required in the web interface). Is it by design?


Currently, the schemas are not validated for everything REST request. We are still working on this. Will be published with the 1.7.0 release.


Ok, thank you for your answers.