-
Notifications
You must be signed in to change notification settings - Fork 1
Object Type Creation
Object types (or resource types) are core feature of DummyAPI. It is dead simple: you define name and DummyAPI starts handling request to URL like '/api/1/[resource type name]/[whatever]'.
When some object type is selected, table on the objects panel shows existing instances of this resource. To create one more instance - put any valid javascript object in JSON notation into field Object Data and press Create button.
Each instance has three read-only fields:
- app_id - your application id
- __objectType - name of resource type to which instance belongs
- _id - database engine generated id
To remove instance - select it in the table and press button with 'minus' symbol below the table
To edit instance - select it and press 'edit'
Id field changes field name by which you can select resource instance. By default, '_id' is used. Changing id field affects all requests to/from application API and doesn't affect Backend configuration API
For example, you have resource 'User' with next structure
{
"_id": "505c0f062ebc497b11000019",
"user_name": "John",
"id": 1
}
and want to access it by 'user_name'. After changing id field to 'user_name' URL '/api/1/User/John' become valid for your application