From 6e552a26da755eda02605aa294d197672f55b395 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 20 Mar 2024 10:17:28 -0700 Subject: [PATCH] lexicon nits: use string format `uri` in more places (#2348) * lexicons: use format=uri for more bsky URLs * lexicons: use format=uri for URLs in server description (links to policies) * codegen lex changes --- lexicons/app/bsky/actor/defs.json | 8 ++++---- lexicons/app/bsky/embed/external.json | 2 +- lexicons/app/bsky/embed/images.json | 2 ++ lexicons/app/bsky/feed/defs.json | 2 +- lexicons/app/bsky/graph/defs.json | 4 ++-- lexicons/com/atproto/server/describeServer.json | 4 ++-- packages/api/src/client/lexicons.ts | 12 ++++++++++++ packages/bsky/src/lexicon/lexicons.ts | 12 ++++++++++++ packages/ozone/src/lexicon/lexicons.ts | 12 ++++++++++++ packages/pds/src/lexicon/lexicons.ts | 12 ++++++++++++ 10 files changed, 60 insertions(+), 10 deletions(-) diff --git a/lexicons/app/bsky/actor/defs.json b/lexicons/app/bsky/actor/defs.json index 1ad8493002..45f7386945 100644 --- a/lexicons/app/bsky/actor/defs.json +++ b/lexicons/app/bsky/actor/defs.json @@ -13,7 +13,7 @@ "maxGraphemes": 64, "maxLength": 640 }, - "avatar": { "type": "string" }, + "avatar": { "type": "string", "format": "uri" }, "associated": { "type": "ref", "ref": "#profileAssociated" @@ -41,7 +41,7 @@ "maxGraphemes": 256, "maxLength": 2560 }, - "avatar": { "type": "string" }, + "avatar": { "type": "string", "format": "uri" }, "associated": { "type": "ref", "ref": "#profileAssociated" @@ -70,8 +70,8 @@ "maxGraphemes": 256, "maxLength": 2560 }, - "avatar": { "type": "string" }, - "banner": { "type": "string" }, + "avatar": { "type": "string", "format": "uri" }, + "banner": { "type": "string", "format": "uri" }, "followersCount": { "type": "integer" }, "followsCount": { "type": "integer" }, "postsCount": { "type": "integer" }, diff --git a/lexicons/app/bsky/embed/external.json b/lexicons/app/bsky/embed/external.json index b9c8c1596d..b9930dff2b 100644 --- a/lexicons/app/bsky/embed/external.json +++ b/lexicons/app/bsky/embed/external.json @@ -44,7 +44,7 @@ "uri": { "type": "string", "format": "uri" }, "title": { "type": "string" }, "description": { "type": "string" }, - "thumb": { "type": "string" } + "thumb": { "type": "string", "format": "uri" } } } } diff --git a/lexicons/app/bsky/embed/images.json b/lexicons/app/bsky/embed/images.json index 307607bb7c..7de9d7a862 100644 --- a/lexicons/app/bsky/embed/images.json +++ b/lexicons/app/bsky/embed/images.json @@ -56,10 +56,12 @@ "properties": { "thumb": { "type": "string", + "format": "uri", "description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View." }, "fullsize": { "type": "string", + "format": "uri", "description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View." }, "alt": { diff --git a/lexicons/app/bsky/feed/defs.json b/lexicons/app/bsky/feed/defs.json index 7c40ef3962..0a83fa71a2 100644 --- a/lexicons/app/bsky/feed/defs.json +++ b/lexicons/app/bsky/feed/defs.json @@ -135,7 +135,7 @@ "type": "array", "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } }, - "avatar": { "type": "string" }, + "avatar": { "type": "string", "format": "uri" }, "likeCount": { "type": "integer", "minimum": 0 }, "labels": { "type": "array", diff --git a/lexicons/app/bsky/graph/defs.json b/lexicons/app/bsky/graph/defs.json index be718f20a1..0b94a21ec8 100644 --- a/lexicons/app/bsky/graph/defs.json +++ b/lexicons/app/bsky/graph/defs.json @@ -10,7 +10,7 @@ "cid": { "type": "string", "format": "cid" }, "name": { "type": "string", "maxLength": 64, "minLength": 1 }, "purpose": { "type": "ref", "ref": "#listPurpose" }, - "avatar": { "type": "string" }, + "avatar": { "type": "string", "format": "uri" }, "labels": { "type": "array", "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } @@ -37,7 +37,7 @@ "type": "array", "items": { "type": "ref", "ref": "app.bsky.richtext.facet" } }, - "avatar": { "type": "string" }, + "avatar": { "type": "string", "format": "uri" }, "labels": { "type": "array", "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } diff --git a/lexicons/com/atproto/server/describeServer.json b/lexicons/com/atproto/server/describeServer.json index 3eab73e068..bbecf651e8 100644 --- a/lexicons/com/atproto/server/describeServer.json +++ b/lexicons/com/atproto/server/describeServer.json @@ -45,8 +45,8 @@ "links": { "type": "object", "properties": { - "privacyPolicy": { "type": "string" }, - "termsOfService": { "type": "string" } + "privacyPolicy": { "type": "string", "format": "uri" }, + "termsOfService": { "type": "string", "format": "uri" } } }, "contact": { diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index ba51eb63aa..c30a2e1c88 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -2438,9 +2438,11 @@ export const schemaDict = { properties: { privacyPolicy: { type: 'string', + format: 'uri', }, termsOfService: { type: 'string', + format: 'uri', }, }, }, @@ -3621,6 +3623,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3663,6 +3666,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3709,9 +3713,11 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, banner: { type: 'string', + format: 'uri', }, followersCount: { type: 'integer', @@ -4388,6 +4394,7 @@ export const schemaDict = { }, thumb: { type: 'string', + format: 'uri', }, }, }, @@ -4468,11 +4475,13 @@ export const schemaDict = { properties: { thumb: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.', }, fullsize: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.', }, @@ -4886,6 +4895,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, likeCount: { type: 'integer', @@ -6201,6 +6211,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', @@ -6258,6 +6269,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index 147772cb32..af4614f72b 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -2438,9 +2438,11 @@ export const schemaDict = { properties: { privacyPolicy: { type: 'string', + format: 'uri', }, termsOfService: { type: 'string', + format: 'uri', }, }, }, @@ -3622,6 +3624,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3664,6 +3667,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3710,9 +3714,11 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, banner: { type: 'string', + format: 'uri', }, followersCount: { type: 'integer', @@ -4389,6 +4395,7 @@ export const schemaDict = { }, thumb: { type: 'string', + format: 'uri', }, }, }, @@ -4469,11 +4476,13 @@ export const schemaDict = { properties: { thumb: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.', }, fullsize: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.', }, @@ -4887,6 +4896,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, likeCount: { type: 'integer', @@ -6202,6 +6212,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', @@ -6259,6 +6270,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index ab8be8ab75..45220154eb 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -2438,9 +2438,11 @@ export const schemaDict = { properties: { privacyPolicy: { type: 'string', + format: 'uri', }, termsOfService: { type: 'string', + format: 'uri', }, }, }, @@ -3622,6 +3624,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3664,6 +3667,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3710,9 +3714,11 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, banner: { type: 'string', + format: 'uri', }, followersCount: { type: 'integer', @@ -4389,6 +4395,7 @@ export const schemaDict = { }, thumb: { type: 'string', + format: 'uri', }, }, }, @@ -4469,11 +4476,13 @@ export const schemaDict = { properties: { thumb: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.', }, fullsize: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.', }, @@ -4887,6 +4896,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, likeCount: { type: 'integer', @@ -6202,6 +6212,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', @@ -6259,6 +6270,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index ab8be8ab75..45220154eb 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -2438,9 +2438,11 @@ export const schemaDict = { properties: { privacyPolicy: { type: 'string', + format: 'uri', }, termsOfService: { type: 'string', + format: 'uri', }, }, }, @@ -3622,6 +3624,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3664,6 +3667,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, associated: { type: 'ref', @@ -3710,9 +3714,11 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, banner: { type: 'string', + format: 'uri', }, followersCount: { type: 'integer', @@ -4389,6 +4395,7 @@ export const schemaDict = { }, thumb: { type: 'string', + format: 'uri', }, }, }, @@ -4469,11 +4476,13 @@ export const schemaDict = { properties: { thumb: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.', }, fullsize: { type: 'string', + format: 'uri', description: 'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.', }, @@ -4887,6 +4896,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, likeCount: { type: 'integer', @@ -6202,6 +6212,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array', @@ -6259,6 +6270,7 @@ export const schemaDict = { }, avatar: { type: 'string', + format: 'uri', }, labels: { type: 'array',