kartevonmorgen / openfairdb

Open Fair DB is the CreativCommons Backend of Kartevonmorgen.org
http://www.openfairdb.org
GNU Affero General Public License v3.0
55 stars 18 forks source link

Solved: Update Swagger Post example: id:"null" mandatory while creation #339

Open wellemut opened 3 years ago

wellemut commented 3 years ago

Problem

New API Users are confuse why posting is not working as in the example in swagger { "title": "string", "description": "string", "lat": 37.2, "lng": 120.7, "street": "string", "zip": "string", "city": "string", "country": "string", "state": "string", "contact_name": "John Smith", "email": "john.smith@example.com", "telephone": "001 123456789", "homepage": "https://www.slowtec.de/", "opening_hours": "24/7", "founded_on": {}, "categories": [ "string" ], "tags": [ "organic", "non-profit" ], "image_url": "https://www.slowtec.de/", "image_link_url": "https://www.slowtec.de/", "links": [ { "url": "https://www.slowtec.de/", "title": "string", "description": "string" } ], "license": "ODbL-1.0" }

Solution

Update the swagger example The part "id":null is mandatory!!!

{"title":"Ernährungsrat Oldenburg","description":"Gemeinsam für eine nachhaltige Ernährung in der Region","tags":["ernährungsrat"],"lat":53.1389753,"lng":8.2146017,"city":"Oldenburg","version":1,"categories":["2cd00bebec0c48ba9db761da48678134"],"links":[],"id":null,"license":"CC0-1.0"}

wellemut commented 3 years ago

@navid-kalaei We just tested the API and made a direct API-Post-Request Result: ID:"null" is not needed!

So the documentation is correct here. There is another error somewhere