这是indexloc提供的服务,不要输入任何密码
Skip to content

Enabling recursive process structs for patameters #870

@birukbelay

Description

@birukbelay

On huma parameters are not checked recursively, on structs which limits us to only embedding structs for queries
on humas code on huma/huma.go line 213: it sets recurseFields to false,
, false, "Body")

but because of that it prevents use of nested structs specially for such cases
func (uh *IGenericController[T, C, U, F, Q]) OffsetPaginated(ctx context.Context, filter *struct {
Filter F
Query Q
dtos.PaginationInput
}) (*dtos.HumaResponse[dtos.PResp[[]T]], error) {

resp, err := DbFetchManyWithOffset[T](uh.GormConn, ctx, filter.Filter, filter.PaginationInput)
return dtos.PHumaReturn(resp, err)

}

because F and Q are Generic type i could not just embed them with out Filter & Query fields,
so only by setting the value on huma/huma.go:213 we can fix this problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions