Last active
February 13, 2019 22:03
-
-
Save FagnerMartinsBrack/ff27e58fae538e86bf25d577cb7319b1 to your computer and use it in GitHub Desktop.
(Medium) - Evolvable APIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Response for: | |
// GET /start-booking | |
{ | |
"data": [{ | |
"type": "action", | |
"id": "required-fields", | |
"attributes": { | |
"url": "/start-booking", | |
"method": "post", | |
"fields": [{ | |
"type": "text", | |
"name": "username", | |
"read-only": false, | |
"value": "" | |
}, { | |
"type": "text", | |
"name": "intendedDoctor", | |
"read-only": false, | |
"value": "" | |
}] | |
} | |
}] | |
} | |
// Response for: | |
// POST /start-booking | |
// With request body: | |
// { "username": "mary.doe", "intendedDoctor": "jane" } | |
{ | |
"data": [{ | |
"type": "action", | |
"id": "required-fields", | |
"attributes": { | |
"url": "/start-booking", | |
"method": "post", | |
"fields": [{ | |
"type": "text", | |
"name": "username", | |
"read-only": true, | |
"value": "mary.doe" | |
}, { | |
"type": "text", | |
"name": "intendedDoctor", | |
"read-only": true, | |
"value": "jane" | |
}, { | |
"type": "select", | |
"name": "available-time-slots", | |
"read-only": false, | |
"value": "", | |
"options": [ | |
{ "value": "2018-05-01T10:00:00" }, | |
{ "value": "2018-05-01T10:15:00" }, | |
{ "value": "2018-05-01T10:30:00" } | |
] | |
}, { | |
"type": "text", | |
"name": "booking", | |
"read-only": false, | |
"value": "" | |
}] | |
} | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment