Skip to content

Commit

Permalink
lexicon nits: use string format uri in more places (#2348)
Browse files Browse the repository at this point in the history
* lexicons: use format=uri for more bsky URLs

* lexicons: use format=uri for URLs in server description (links to policies)

* codegen lex changes
  • Loading branch information
bnewbold committed Mar 20, 2024
1 parent f8dffa2 commit 6e552a2
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lexicons/app/bsky/actor/defs.json
Expand Up @@ -13,7 +13,7 @@
"maxGraphemes": 64,
"maxLength": 640
},
"avatar": { "type": "string" },
"avatar": { "type": "string", "format": "uri" },
"associated": {
"type": "ref",
"ref": "#profileAssociated"
Expand Down Expand Up @@ -41,7 +41,7 @@
"maxGraphemes": 256,
"maxLength": 2560
},
"avatar": { "type": "string" },
"avatar": { "type": "string", "format": "uri" },
"associated": {
"type": "ref",
"ref": "#profileAssociated"
Expand Down Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion lexicons/app/bsky/embed/external.json
Expand Up @@ -44,7 +44,7 @@
"uri": { "type": "string", "format": "uri" },
"title": { "type": "string" },
"description": { "type": "string" },
"thumb": { "type": "string" }
"thumb": { "type": "string", "format": "uri" }
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions lexicons/app/bsky/embed/images.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion lexicons/app/bsky/feed/defs.json
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions lexicons/app/bsky/graph/defs.json
Expand Up @@ -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" }
Expand All @@ -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" }
Expand Down
4 changes: 2 additions & 2 deletions lexicons/com/atproto/server/describeServer.json
Expand Up @@ -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": {
Expand Down
12 changes: 12 additions & 0 deletions packages/api/src/client/lexicons.ts
Expand Up @@ -2438,9 +2438,11 @@ export const schemaDict = {
properties: {
privacyPolicy: {
type: 'string',
format: 'uri',
},
termsOfService: {
type: 'string',
format: 'uri',
},
},
},
Expand Down Expand Up @@ -3621,6 +3623,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
associated: {
type: 'ref',
Expand Down Expand Up @@ -3663,6 +3666,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
associated: {
type: 'ref',
Expand Down Expand Up @@ -3709,9 +3713,11 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
banner: {
type: 'string',
format: 'uri',
},
followersCount: {
type: 'integer',
Expand Down Expand Up @@ -4388,6 +4394,7 @@ export const schemaDict = {
},
thumb: {
type: 'string',
format: 'uri',
},
},
},
Expand Down Expand Up @@ -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.',
},
Expand Down Expand Up @@ -4886,6 +4895,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
likeCount: {
type: 'integer',
Expand Down Expand Up @@ -6201,6 +6211,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
labels: {
type: 'array',
Expand Down Expand Up @@ -6258,6 +6269,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
labels: {
type: 'array',
Expand Down
12 changes: 12 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Expand Up @@ -2438,9 +2438,11 @@ export const schemaDict = {
properties: {
privacyPolicy: {
type: 'string',
format: 'uri',
},
termsOfService: {
type: 'string',
format: 'uri',
},
},
},
Expand Down Expand Up @@ -3622,6 +3624,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
associated: {
type: 'ref',
Expand Down Expand Up @@ -3664,6 +3667,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
associated: {
type: 'ref',
Expand Down Expand Up @@ -3710,9 +3714,11 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
banner: {
type: 'string',
format: 'uri',
},
followersCount: {
type: 'integer',
Expand Down Expand Up @@ -4389,6 +4395,7 @@ export const schemaDict = {
},
thumb: {
type: 'string',
format: 'uri',
},
},
},
Expand Down Expand Up @@ -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.',
},
Expand Down Expand Up @@ -4887,6 +4896,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
likeCount: {
type: 'integer',
Expand Down Expand Up @@ -6202,6 +6212,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
labels: {
type: 'array',
Expand Down Expand Up @@ -6259,6 +6270,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
labels: {
type: 'array',
Expand Down
12 changes: 12 additions & 0 deletions packages/ozone/src/lexicon/lexicons.ts
Expand Up @@ -2438,9 +2438,11 @@ export const schemaDict = {
properties: {
privacyPolicy: {
type: 'string',
format: 'uri',
},
termsOfService: {
type: 'string',
format: 'uri',
},
},
},
Expand Down Expand Up @@ -3622,6 +3624,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
associated: {
type: 'ref',
Expand Down Expand Up @@ -3664,6 +3667,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
associated: {
type: 'ref',
Expand Down Expand Up @@ -3710,9 +3714,11 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
banner: {
type: 'string',
format: 'uri',
},
followersCount: {
type: 'integer',
Expand Down Expand Up @@ -4389,6 +4395,7 @@ export const schemaDict = {
},
thumb: {
type: 'string',
format: 'uri',
},
},
},
Expand Down Expand Up @@ -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.',
},
Expand Down Expand Up @@ -4887,6 +4896,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
likeCount: {
type: 'integer',
Expand Down Expand Up @@ -6202,6 +6212,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
labels: {
type: 'array',
Expand Down Expand Up @@ -6259,6 +6270,7 @@ export const schemaDict = {
},
avatar: {
type: 'string',
format: 'uri',
},
labels: {
type: 'array',
Expand Down

0 comments on commit 6e552a2

Please sign in to comment.