Skip to content

[cmd/mdatagen] Implement array validation in generated Go config code #14808

@jkoronaAtCisco

Description

@jkoronaAtCisco

Part of #14809

Implement support for the JSON Schema array validation keywords in Go code generated by mdatagen.

Scope

  • minItems: Array must contain at least the specified number of items.
  • maxItems: Array must contain at most the specified number of items.
  • uniqueItems: All items in the array must be unique.
  • contains: At least one item in the array must match the specified schema.

Acceptance Criteria

  • Generated Validate() methods enforce all four array constraints.
  • Validation errors clearly indicate which constraint was violated.
  • Unit tests cover edge cases (empty arrays, boundary sizes, duplicate detection, contains matching).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions