/** id type */ type id = integer; /** @title User */ type user = struct { /** unique id of the user */ id: id, name: string?, type: enum {"admin", "writer", "reader"}, SNSs: [string], }; /** * @title Group * this expresses a group of users */ type group = struct { id: id, admin: user?, members: [user], // this is short hand of `string where format = "date-time"` created_at: format("date-time"), }; type password = string where 1 <= length && length <= 128 && it =~ /[a-z0-9!"#$%&'()=~|@]+/; type error = struct { code: string, message?: string, }; type not_found = error & struct { code: "not_found", };