fix(api): typed OpenAPI query params and not-found messages that hide private projects
- Query DTO properties with a default value (limit, offset, days, perColumn, assignedToMe, search, archived, requiresReason, force) were documented as `object` in openapi.json, which broke generated clients. They now declare their type explicitly. - Reading a private project, ticket, release or its comments without access answered "Project <internal id> not found", confirming the project exists. ReadAccess now reports what the caller asked for (e2e covered). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -132,11 +132,11 @@ export class WorkflowStatusBodyDto {
|
||||
@ApiProperty({ enum: SETTING_COLORS, enumName: 'SettingColor' })
|
||||
@IsIn(SETTING_COLORS)
|
||||
color!: string;
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@ApiPropertyOptional({ type: Boolean, default: false })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
requiresReason = false;
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@ApiPropertyOptional({ type: Boolean, default: false })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
archived = false;
|
||||
@@ -164,7 +164,7 @@ export class IssueTypeOptionBodyDto {
|
||||
@ApiProperty({ enum: SETTING_COLORS, enumName: 'SettingColor' })
|
||||
@IsIn(SETTING_COLORS)
|
||||
color!: string;
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@ApiPropertyOptional({ type: Boolean, default: false })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
archived = false;
|
||||
@@ -177,7 +177,7 @@ export class AreaOptionBodyDto {
|
||||
@MinLength(1)
|
||||
@MaxLength(40)
|
||||
name!: string;
|
||||
@ApiPropertyOptional({ default: false })
|
||||
@ApiPropertyOptional({ type: Boolean, default: false })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
archived = false;
|
||||
@@ -218,7 +218,7 @@ export class ProjectSettingsBodyDto {
|
||||
}
|
||||
|
||||
export class AnalyticsQueryDto {
|
||||
@ApiPropertyOptional({ default: 90, minimum: 7, maximum: 365 })
|
||||
@ApiPropertyOptional({ type: Number, default: 90, minimum: 7, maximum: 365 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -249,7 +249,7 @@ export class BoardQueryDto {
|
||||
@Matches(SETTING_ID)
|
||||
area?: string;
|
||||
|
||||
@ApiPropertyOptional({ default: 50, minimum: 1, maximum: 200 })
|
||||
@ApiPropertyOptional({ type: Number, default: 50, minimum: 1, maximum: 200 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -264,7 +264,7 @@ export class ActivityQueryDto {
|
||||
@IsString()
|
||||
issueId?: string;
|
||||
|
||||
@ApiPropertyOptional({ default: 50, minimum: 1, maximum: 200 })
|
||||
@ApiPropertyOptional({ type: Number, default: 50, minimum: 1, maximum: 200 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -282,7 +282,7 @@ export class ActivityQueryDto {
|
||||
}
|
||||
|
||||
export class PageQueryDto {
|
||||
@ApiPropertyOptional({ default: 50, minimum: 1, maximum: 200 })
|
||||
@ApiPropertyOptional({ type: Number, default: 50, minimum: 1, maximum: 200 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -290,7 +290,7 @@ export class PageQueryDto {
|
||||
@Max(200)
|
||||
limit = 50;
|
||||
|
||||
@ApiPropertyOptional({ default: 0, minimum: 0 })
|
||||
@ApiPropertyOptional({ type: Number, default: 0, minimum: 0 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -302,6 +302,7 @@ export class PageQueryDto {
|
||||
|
||||
export class MyIssuesQueryDto extends PageQueryDto {
|
||||
@ApiPropertyOptional({
|
||||
type: Boolean,
|
||||
default: true,
|
||||
description:
|
||||
'true: tickets assigned to me. false: any ticket of my projects (e.g. ?assignedToMe=false&category=QA)',
|
||||
@@ -333,7 +334,7 @@ export class MyIssuesQueryDto extends PageQueryDto {
|
||||
}
|
||||
|
||||
export class UpcomingReleasesQueryDto {
|
||||
@ApiPropertyOptional({ default: 10, minimum: 1, maximum: 50 })
|
||||
@ApiPropertyOptional({ type: Number, default: 10, minimum: 1, maximum: 50 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@@ -613,6 +614,7 @@ export class UpdateReleaseDto extends PartialType(CreateReleaseDto) {}
|
||||
|
||||
export class PublishReleaseDto {
|
||||
@ApiPropertyOptional({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
description: 'Publish even with unfinished tickets',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user