| ▲ | skybrian 2 hours ago | |||||||
Are these just guidelines or is this enforced in some way? I guess readers could validate and skip anything that doesn't match their schema. | ||||||||
| ▲ | extraduder_ire an hour ago | parent | next [-] | |||||||
Most apps reading records will validate a record against the schema for that type. e.g. there's nothing stopping you from making a app.bsky.feed.post record with more than 300 graphemes in the "text" field, but that post won't appear in the "official" app/website because it fails schema validation. Similarly, there's nothing stopping you from adding another field in your post. It'll just get ignored because the app you're using doesn't know about it. e.g. posts bridged from mastodon by bridgy have an extra field containing the full original post's text, which you can display in your app if desired. reddwarf.app does this with these posts. Here's the schema for bluesky posts, if you're interested: https://pdsls.dev/at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.... | ||||||||
| ||||||||
| ▲ | danabramov 31 minutes ago | parent | prev [-] | |||||||
Yeah, look for this part in the the article: Lexicon validation works the same way. The com.tumblr in com.tumblr.post signals who designed the lexicon, but the records themselves could have been created by any app at all. This is why apps always treat records as untrusted input, similar to POST request bodies. When you generate type definitions from a lexicon, you also get a function that will do the validation for you. If some record passes the check, great—you get a typed object. If not, fine, ignore that record. So, validate on read, just like files. | ||||||||