Schema { hosts = [Host { env: "dev", address: "https://127.0.0.1:5000" }, Host { env: "prod", address: "https://api.your-domain.com" }] versioning = Versioning { format: Headers, header: Some("http-standard") } types = [Ok(TypeDecl { name = update at = Ok(DataTypeDecl { data_type: Object("date"), is_required: true }) is_latest = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) note = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) interested_user_ids = Ok(DataTypeDecl { data_type: Array(Primitive(Int)), is_required: true }) ), Ok(TypeDecl { name = message author = Ok(DataTypeDecl { data_type: Object("user"), is_required: true }) text = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) update = Ok(DataTypeDecl { data_type: Object("update"), is_required: false }) marks = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = marks read = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) ack = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) ), is_required: true }) ), Ok(TypeDecl { name = media id = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) type = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) versions = Ok(DataTypeDecl { data_type: Object("media"), is_required: true }) thumbnail = Ok(DataTypeDecl { data_type: Object("media"), is_required: true }) uploaded = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) index = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) status = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) caption = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), Ok(TypeDecl { name = media_versions normal = Ok(DataTypeDecl { data_type: Object("media"), is_required: true }) collapsed = Ok(DataTypeDecl { data_type: Object("media"), is_required: true }) expanded = Ok(DataTypeDecl { data_type: Object("media"), is_required: true }) tiny = Ok(DataTypeDecl { data_type: Object("media"), is_required: true }) ), Ok(TypeDecl { name = media_version url = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) size = Ok(DataTypeDecl { data_type: Object("size"), is_required: true }) ), Ok(TypeDecl { name = size width = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) height = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) ), Ok(TypeDecl { name = social_media links = Ok(DataTypeDecl { data_type: Array(Object("link")), is_required: false }) hashtags = Ok(DataTypeDecl { data_type: Array(Object("hashtag")), is_required: false }) mentions = Ok(DataTypeDecl { data_type: Array(Object("mention")), is_required: false }) ), Ok(TypeDecl { name = link text = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) indices = Ok(DataTypeDecl { data_type: Array(Primitive(Int)), is_required: false }) ), Ok(TypeDecl { name = hashtag text = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) indices = Ok(DataTypeDecl { data_type: Array(Primitive(Int)), is_required: false }) ), Ok(TypeDecl { name = mention user = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = user id = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) username = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) first_name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) last_name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) ), is_required: true }) indices = Ok(DataTypeDecl { data_type: Array(Primitive(Int)), is_required: false }) ), Ok(TypeDecl { name = settings version = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) feed = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = feed timeline_order = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = timeline_order all = Ok(DataTypeDecl { data_type: Array(Primitive(Str)), is_required: true }) selected = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), is_required: true }) ), is_required: true }) categories = Ok(DataTypeDecl { data_type: Array(Object("category")), is_required: true }) channels = Ok(DataTypeDecl { data_type: Array(Object("channel")), is_required: true }) filters = Ok(DataTypeDecl { data_type: Array(Object("filter")), is_required: true }) story = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = story backgrounds = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = backgrounds backgrounds = Ok(DataTypeDecl { data_type: Array(Object("background")), is_required: true }) new = Ok(DataTypeDecl { data_type: Array(Object("background")), is_required: true }) popular = Ok(DataTypeDecl { data_type: Array(Object("background")), is_required: true }) ), is_required: true }) privacy = Ok(DataTypeDecl { data_type: Array(Object("privacy")), is_required: true }) commenting_privacy = Ok(DataTypeDecl { data_type: Array(Object("commenting_privacy")), is_required: true }) providers = Ok(DataTypeDecl { data_type: Array(Object("provider")), is_required: true }) story_types = Ok(DataTypeDecl { data_type: Array(Object("story_type")), is_required: true }) ), is_required: true }) social_accounts = Ok(DataTypeDecl { data_type: Array(Object("social_account")), is_required: true }) ), Ok(TypeDecl { name = category id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) enabled = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) ), Ok(TypeDecl { name = channel id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) caption = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) enabled = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) default_index = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) readonly = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) category = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) color = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) index = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) ), Ok(TypeDecl { name = filter id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) caption = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) enabled = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) index = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) readonly = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) channel = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) resource_url = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = resource_url svg = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), is_required: true }) position = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) ), Ok(TypeDecl { name = background id = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) image = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = image full = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) mini = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), is_required: true }) position = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) index = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) category_id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) kind = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), Ok(TypeDecl { name = privacy id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) value = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), Ok(TypeDecl { name = commenting_privacy id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) value = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), Ok(TypeDecl { name = provider id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), Ok(TypeDecl { name = story_type id = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) i18n = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = i18n name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), is_required: true }) name = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) value = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) enabled = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) components = Ok(DataTypeDecl { data_type: Array(Primitive(Str)), is_required: true }) available_content = Ok(DataTypeDecl { data_type: Array(Primitive(Str)), is_required: true }) ), Ok(TypeDecl { name = new_channel_position channel = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) index = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) )] interfaces = [Ok(InterfaceDecl { ident: "history", params: [], spec: Api(ApiSpec { method: Get, payload: Some(Query([PropertyDecl { name: "period", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }, PropertyDecl { name: "limit", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) }, PropertyDecl { name: "after", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) }])), responses: Some({Fixed(200): TypeDecl { name = 200 items = Ok(DataTypeDecl { data_type: Array(Object("update")), is_required: true }) after = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) }) }) }), Ok(InterfaceDecl { ident: "auth/signin", params: [], spec: Api(ApiSpec { method: Post, payload: Some(Body([PropertyDecl { name: "login", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }, PropertyDecl { name: "password", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }])), responses: Some({Fixed(200): TypeDecl { name = 200 headers = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = headers refresh-token = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) authorization = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) ), is_required: true }) }) }) }), Ok(InterfaceDecl { ident: "auth/signup", params: [], spec: Api(ApiSpec { method: Post, payload: Some(Body([PropertyDecl { name: "login", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }, PropertyDecl { name: "password", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }])), responses: None }) }), Ok(InterfaceDecl { ident: "auth/logout", params: [], spec: Api(ApiSpec { method: Delete, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "auth/refresh", params: [], spec: Api(ApiSpec { method: Post, payload: None, responses: Some({Fixed(200): TypeDecl { name = 200 headers = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = headers refresh-token = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) authorization = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) ), is_required: true }) }) }) }), Ok(InterfaceDecl { ident: "messages/{message_id}/read_by/", params: ["message_id"], spec: Api(ApiSpec { method: Get, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "messages/{message_id}/tree/{node_id}/", params: ["message_id", "node_id"], spec: Api(ApiSpec { method: Get, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "messages/{message_id}/tree/{node_id}/updates/", params: ["message_id", "node_id"], spec: Api(ApiSpec { method: Get, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "messages/{message_id}/tree/{node_id}/updates/", params: ["message_id", "node_id"], spec: Api(ApiSpec { method: Get, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "messages", params: [], spec: Api(ApiSpec { method: Get, payload: Some(Query([PropertyDecl { name: "limit", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }) }, PropertyDecl { name: "after", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) }])), responses: Some({Fixed(200): TypeDecl { name = 200 items = Ok(DataTypeDecl { data_type: Array(Object("message")), is_required: true }) after = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: false }) }) }) }), Ok(InterfaceDecl { ident: "messages", params: [], spec: Api(ApiSpec { method: Post, payload: Some(Body([ PropertyDecl { name: "text", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }, PropertyDecl { name: "receiver_id", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) } ])), responses: Some({ Fixed(401): TypeDecl { name = 200 code = Ok(DataTypeDecl { data_type: Primitive(Int), is_required: true }), Fixed(200): TypeDecl { name = message author = Ok(DataTypeDecl { data_type: Object("user"), is_required: true }) text = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) update = Ok(DataTypeDecl { data_type: Object("update"), is_required: false }) marks = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = marks read = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) ack = Ok(DataTypeDecl { data_type: Primitive(Bool), is_required: true }) ), is_required: true }), Prefix(4): TypeDecl { name = 200 err = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }) }) }), Ok(InterfaceDecl { ident: "messages/{message_id}", params: ["message_id"], spec: Api(ApiSpec { method: Delete, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "messages/search/{user_id}", params: ["user_id"], spec: Api(ApiSpec { method: Get, payload: None, responses: None }) }), Ok(InterfaceDecl { ident: "messages/read", params: [], spec: Api(ApiSpec { method: Post, payload: Some(Body([PropertyDecl { name: "message_id", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }])), responses: None }) }), Ok(InterfaceDecl { ident: "settings", params: [], spec: Api(ApiSpec { method: Get, payload: None, responses: Some({Fixed(200): TypeDecl { name = settings version = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) feed = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = feed timeline_order = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = timeline_order all = Ok(DataTypeDecl { data_type: Array(Primitive(Str)), is_required: true }) selected = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) ), is_required: true }) ), is_required: true }) categories = Ok(DataTypeDecl { data_type: Array(Object("category")), is_required: true }) channels = Ok(DataTypeDecl { data_type: Array(Object("channel")), is_required: true }) filters = Ok(DataTypeDecl { data_type: Array(Object("filter")), is_required: true }) story = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = story backgrounds = Ok(DataTypeDecl { data_type: ObjectDecl(TypeDecl { name = backgrounds backgrounds = Ok(DataTypeDecl { data_type: Array(Object("background")), is_required: true }) new = Ok(DataTypeDecl { data_type: Array(Object("background")), is_required: true }) popular = Ok(DataTypeDecl { data_type: Array(Object("background")), is_required: true }) ), is_required: true }) privacy = Ok(DataTypeDecl { data_type: Array(Object("privacy")), is_required: true }) commenting_privacy = Ok(DataTypeDecl { data_type: Array(Object("commenting_privacy")), is_required: true }) providers = Ok(DataTypeDecl { data_type: Array(Object("provider")), is_required: true }) story_types = Ok(DataTypeDecl { data_type: Array(Object("story_type")), is_required: true }) ), is_required: true }) social_accounts = Ok(DataTypeDecl { data_type: Array(Object("social_account")), is_required: true }) }) }) }), Ok(InterfaceDecl { ident: "settings/version", params: [], spec: Api(ApiSpec { method: Get, payload: None, responses: Some({Fixed(200): TypeDecl { name = 200 version = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }) }) }), Ok(InterfaceDecl { ident: "settings/channels", params: [], spec: Api(ApiSpec { method: Put, payload: Some(Body([PropertyDecl { name: "items", data_type_decl: Ok(DataTypeDecl { data_type: Array(Object("new_channel_position")), is_required: true }) }])), responses: Some({Fixed(200): TypeDecl { name = 200 channels = Ok(DataTypeDecl { data_type: Array(Object("channel")), is_required: true }) }) }) }), Ok(InterfaceDecl { ident: "settings/timeline_order", params: [], spec: Api(ApiSpec { method: Put, payload: Some(Body([PropertyDecl { name: "timeline_order", data_type_decl: Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }])), responses: Some({Fixed(200): TypeDecl { name = 200 timeline_order = Ok(DataTypeDecl { data_type: Primitive(Str), is_required: true }) }) }) })]