An exploration of a hypermedia API type with a syntax inspired by kotlin builders.
Main optimization factor here is to find a data format that is better at intermingling structure and semantics.
{
itemtype: "http://schema.org/LocalBusiness"
itemscope: true,
name: "Cascal",
address: "1234 Castro St, Mountain View, CA",
form {
itemprop: "potentialAction",
itemscope: true,
itemtype: "http://schema.org/ReserveAction",
select {
name: "size",
itemprop: "partySize",
caption { "Select your party size" }
option { "1", "2", "3", "..." }
}
input {
type: "date",
name: "date",
itemprop: "scheduleDate"
}
select {
name: "time",
itemprop: "scheduledTime",
caption { "What time?" }
option { "7pm", "8pm", "9pm", "..." }
}
}
}