Skip to content

Support day unit in ValidateDuration validation function #1013

@lindseysimple

Description

@lindseysimple

🚀 Feature Request

Relevant Package [REQUIRED]

This feature request affects to all DTO fields with the edgex-dto-duration validation tag

Description [REQUIRED]

The ValidateDuration function, which is registered under the edgex-dto-duration validation tag, currently supports only the following time units: "ns" (nanoseconds), "us" or "µs" (microseconds), "ms" (milliseconds), "s" (seconds), "m" (minutes), and "h" (hours), consistent with Go's time.ParseDuration() behavior.

However, the "d" (days) unit is commonly used in certain contexts—such as retention policy configurations—and would be a valuable addition to the set of supported duration units.

Describe the solution you'd like

Enhance the ValidateDuration validation function to support the "d" (days) time unit.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Palau Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions