Skip to content

Commit 5bb78b3

Browse files
authored
fix: remove wrong exclusiveMinimum in api spec (#985)
1 parent 4e034b4 commit 5bb78b3

File tree

11 files changed

+53
-65
lines changed

11 files changed

+53
-65
lines changed

routes/__snapshots__/index.test.ts.snap

Lines changed: 28 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

routes/admin/ep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function setup(app: App) {
2121
schema: {
2222
hide: true,
2323
params: t.Object({
24-
episodeID: t.Integer({ exclusiveMinimum: 0 }),
24+
episodeID: t.Integer({ minimum: 1 }),
2525
}),
2626
},
2727
},

routes/admin/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function setup(app: App) {
4949
{
5050
schema: {
5151
hide: true,
52-
params: t.Object({ subjectID: t.Integer({ exclusiveMinimum: 0 }) }),
52+
params: t.Object({ subjectID: t.Integer({ minimum: 1 }) }),
5353
},
5454
preHandler: [
5555
requirePermission('delete subject cover', (a) => a.permission.subject_cover_erase),
@@ -66,9 +66,9 @@ export async function setup(app: App) {
6666
schema: {
6767
hide: true,
6868
params: t.Object({
69-
subjectID: t.Integer({ exclusiveMinimum: 0 }),
69+
subjectID: t.Integer({ minimum: 1 }),
7070
}),
71-
body: t.Object({ imageID: t.Integer({ exclusiveMinimum: 0 }) }),
71+
body: t.Object({ imageID: t.Integer({ minimum: 1 }) }),
7272
},
7373
preHandler: [
7474
requirePermission('delete subject cover', (a) => a.permission.subject_cover_erase),

routes/demo/token/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ export function setup(app: App) {
5555
hide: true,
5656
body: t.Object({
5757
name: t.String({}),
58-
duration_days: t.Integer({ exclusiveMinimum: 0 }),
58+
days: t.Integer({ minimum: 1 }),
5959
}),
6060
response: {
6161
200: t.String(),
6262
},
6363
},
6464
preHandler: [requireLogin('delete your token')],
6565
},
66-
async ({ auth, body: { duration_days, name } }) => {
66+
async ({ auth, body: { days, name } }) => {
6767
const token = await randomBase62String(40);
6868
await db.insert(chiiAccessToken).values({
6969
userID: auth.userID.toString(),
7070
expiredAt: DateTime.now()
71-
.plus(Duration.fromObject({ day: duration_days }))
71+
.plus(Duration.fromObject({ day: days }))
7272
.toJSDate(),
7373
type: TokenType.AccessToken,
7474
clientID: '',

routes/private/routes/episode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function setup(app: App) {
7979
summary: '获取条目的剧集吐槽箱',
8080
tags: [Tag.Episode],
8181
params: t.Object({
82-
episodeID: t.Integer({ examples: [1075440], minimum: 0 }),
82+
episodeID: t.Integer({ minimum: 1 }),
8383
}),
8484
response: {
8585
200: t.Array(res.EpisodeComment),

routes/private/routes/subject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ export async function setup(app: App) {
833833
security: [{ [Security.CookiesSession]: [], [Security.HTTPBearer]: [] }],
834834
operationId: 'createSubjectTopic',
835835
params: t.Object({
836-
subjectID: t.Integer({ examples: [114514], minimum: 0 }),
836+
subjectID: t.Integer({ minimum: 1 }),
837837
}),
838838
response: {
839839
200: t.Object({
@@ -997,7 +997,7 @@ export async function setup(app: App) {
997997
tags: [Tag.Topic],
998998
security: [{ [Security.CookiesSession]: [], [Security.HTTPBearer]: [] }],
999999
params: t.Object({
1000-
topicID: t.Integer({ examples: [371602], minimum: 0 }),
1000+
topicID: t.Integer({ minimum: 1 }),
10011001
}),
10021002
body: req.UpdateTopic,
10031003
response: {

routes/private/routes/wiki/person/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function setup(app: App) {
5050
operationId: 'getPersonWikiInfo',
5151
description: '获取当前的 wiki 信息',
5252
params: t.Object({
53-
personID: t.Integer({ examples: [1], minimum: 0 }),
53+
personID: t.Integer({ minimum: 1 }),
5454
}),
5555
security: [{ [Security.CookiesSession]: [], [Security.HTTPBearer]: [] }],
5656
response: {
@@ -91,7 +91,7 @@ export async function setup(app: App) {
9191
tags: [Tag.Wiki],
9292
operationId: 'patchPersonInfo',
9393
params: t.Object({
94-
personID: t.Integer({ examples: [1], minimum: 0 }),
94+
personID: t.Integer({ minimum: 1 }),
9595
}),
9696
security: [{ [Security.CookiesSession]: [], [Security.HTTPBearer]: [] }],
9797
body: t.Object(

routes/private/routes/wiki/subject/ep.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export async function setup(app: App) {
7070
operationId: 'getEpisodeWikiInfo',
7171
description: [].join('\n\n'),
7272
params: t.Object({
73-
episodeID: t.Integer({ examples: [1148124], minimum: 0 }),
73+
episodeID: t.Integer({ minimum: 1 }),
7474
}),
7575
security: [{ [Security.CookiesSession]: [] }],
7676
response: {
@@ -124,7 +124,7 @@ export async function setup(app: App) {
124124
operationId: 'patchEpisodeWikiInfo',
125125
description: [].join('\n\n'),
126126
params: t.Object({
127-
episodeID: t.Integer({ examples: [1148124], minimum: 0 }),
127+
episodeID: t.Integer({ minimum: 1 }),
128128
}),
129129
security: [{ [Security.CookiesSession]: [] }],
130130
body: t.Object(

routes/private/routes/wiki/subject/image.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ export function setup(app: App) {
236236
description: `需要 \`subjectWikiEdit\` 权限`,
237237
summary: '为条目封面投票',
238238
params: t.Object({
239-
subjectID: t.Integer({ exclusiveMinimum: 0 }),
240-
imageID: t.Integer({ exclusiveMinimum: 0 }),
239+
subjectID: t.Integer({ minimum: 1 }),
240+
imageID: t.Integer({ minimum: 1 }),
241241
}),
242242
response: {
243243
200: t.Object({}),
@@ -277,8 +277,8 @@ export function setup(app: App) {
277277
summary: '撤消条目封面投票',
278278
description: `需要 \`subjectWikiEdit\` 权限`,
279279
params: t.Object({
280-
subjectID: t.Integer({ exclusiveMinimum: 0 }),
281-
imageID: t.Integer({ exclusiveMinimum: 0 }),
280+
subjectID: t.Integer({ minimum: 1 }),
281+
imageID: t.Integer({ minimum: 1 }),
282282
}),
283283
response: {
284284
200: t.Object({}),

routes/private/routes/wiki/subject/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export async function setup(app: App) {
174174
operationId: 'subjectInfo',
175175
description: ['获取当前的 wiki 信息'].join('\n\n'),
176176
params: t.Object({
177-
subjectID: t.Integer({ examples: [363612], minimum: 0 }),
177+
subjectID: t.Integer({ minimum: 1 }),
178178
}),
179179
security: [{ [Security.CookiesSession]: [] }],
180180
response: {
@@ -367,7 +367,7 @@ export async function setup(app: App) {
367367
operationId: 'subjectEditHistorySummary',
368368
description: ['获取当前的 wiki 信息'].join('\n\n'),
369369
params: t.Object({
370-
subjectID: t.Integer({ examples: [8], minimum: 0 }),
370+
subjectID: t.Integer({ minimum: 1 }),
371371
}),
372372
security: [{ [Security.CookiesSession]: [] }],
373373
response: {
@@ -414,7 +414,7 @@ export async function setup(app: App) {
414414
operationId: 'putSubjectInfo',
415415
description: '需要 `subjectWikiEdit` 权限',
416416
params: t.Object({
417-
subjectID: t.Integer({ examples: [363612], minimum: 0 }),
417+
subjectID: t.Integer({ minimum: 1 }),
418418
}),
419419
security: [{ [Security.CookiesSession]: [] }],
420420
body: t.Object(
@@ -485,7 +485,7 @@ export async function setup(app: App) {
485485
tags: [Tag.Wiki],
486486
operationId: 'patchSubjectInfo',
487487
params: t.Object({
488-
subjectID: t.Integer({ examples: [363612], minimum: 0 }),
488+
subjectID: t.Integer({ minimum: 1 }),
489489
}),
490490
security: [{ [Security.CookiesSession]: [] }],
491491
body: t.Object(
@@ -584,7 +584,7 @@ export async function setup(app: App) {
584584
operationId: 'createEpisodes',
585585
description: '为条目添加新章节',
586586
params: t.Object({
587-
subjectID: t.Integer({ examples: [363612], minimum: 0 }),
587+
subjectID: t.Integer({ minimum: 1 }),
588588
}),
589589
security: [{ [Security.CookiesSession]: [], [Security.HTTPBearer]: [] }],
590590
body: EpsisodesNew,

0 commit comments

Comments
 (0)