Skip to content

Document Contract

Paul Scarrone edited this page Jan 29, 2016 · 3 revisions

Document Prototype for SPA initialization

I am just thinking this through I want to expose Comments and Responses linked to a user pre-prepared so the application can display them but I don't want to see too much duplication in the payload. Also I could expand these at runtime but I want to keep the front end as naive as possible.

"user": {
    "name": ""
    "responses": [{
        "body": "",
        "prompt": {},
        "comments": [{
            "user": {},
            "body": ""
        }]
    }],
    "comments": [{
        "response": {
            // Might be some duplication here
        },
        "body": ""
    }]
},
"sampledPrompt":{
    "id": "",
    "title": "",
    "body": "",
    "responses": [{
        "id": "",
        "body": "",
        "comments": [{
            "user": {},
            "body": ""
        }]
    }]
}
Clone this wiki locally