daybed icon indicating copy to clipboard operation
daybed copied to clipboard

GET model definition should return the required parameter for all fields.

Open Natim opened this issue 11 years ago • 6 comments
trafficstars

Natim avatar Oct 14 '14 10:10 Natim

Can you give an example of what you mean here ?

leplatrem avatar Oct 14 '14 12:10 leplatrem

Currently when we do a GET on the definition, we cannot tell if the field is required or not.

almet avatar Oct 14 '14 13:10 almet

http GET https://daybed.io/v1/models/todo/definition --auth-type=hawk      --auth='769f36d23f904f1507afc80400553b1271889cabeb975d5193476b00e12f9ab9:

Returns:

{
    "description": "A list of my stuff to do", 
    "fields": [
        {
            "label": "The item", 
            "name": "item", 
            "type": "string"
        }, 
        {
            "choices": [
                "done", 
                "todo"
            ], 
            "label": "is it done or not", 
            "name": "status", 
            "type": "enum"
        }
    ], 
    "title": "todo"
}

Should returns:

{
    "description": "A list of my stuff to do", 
    "fields": [
        {
            "label": "The item", 
            "name": "item", 
            "type": "string",
            "required": true
        }, 
        {
            "choices": [
                "done", 
                "todo"
            ], 
            "label": "is it done or not", 
            "name": "status", 
            "type": "enum",
            "required": true
        }
    ], 
    "title": "todo"
}

Natim avatar Oct 14 '14 13:10 Natim

Then I guess there are not explicitely stored ?

leplatrem avatar Oct 14 '14 19:10 leplatrem

I don't reproduce this locally :(

leplatrem avatar Nov 10 '14 15:11 leplatrem

But do you remotely?

Natim avatar Nov 10 '14 15:11 Natim