Skip to content

[schemas] Migrate model/component wire format to canonical camelCase (v1beta2/v1beta3) #1158

Description

@hortison

Current Situation

The ModelDefinition.Registrant field in v1beta2/model references v1beta1/connection.Connection, which has snake_case JSON tags (created_at, user_id, deleted_at). This causes mesheryctl model generate output and server API responses to emit non-canonical wire format, violating the AGENTS.md contract:

"Wire is camelCase everywhere; DB is snake_case; the ORM layer is the sole translation boundary."

Similarly, ComponentDefinition.Model in both v1beta2 and v1beta3 component schemas references v1beta1/model.ModelDefinition (snake_case JSON tags: components_count, relationships_count). The ComponentSchemaVersion constant in v1beta3/const.go is also stale at "components.meshery.io/v1beta2" while both the YAML default and model init templates already emit v1beta3.

Proposed Change

  1. v1beta2/model.ModelDefinition.Registrant → reference v1beta3/connection.Connection (camelCase JSON tags)
  2. v1beta2/component.ComponentDefinition.Model → reference v1beta2/model.ModelDefinition
  3. v1beta3/component.ComponentDefinition.Model → reference v1beta2/model.ModelDefinition
  4. v1beta3/const.go#ComponentSchemaVersion"components.meshery.io/v1beta3"

Acceptance Criteria

  • mesheryctl model generate emits registrant.createdAt, registrant.userId (camelCase)
  • mesheryctl model generate emits "schemaVersion": "components.meshery.io/v1beta3" in component files
  • go build ./... passes across meshery/schemas, meshery/meshkit, and meshery/meshery
  • No DB AutoMigrate changes required
  • Consumer-audit CI gate passes

Related PRs

  • meshery/meshkit PR: Registry bridge adapters
  • meshery/meshery PR: Server handler + UI field name updates

General Contributor Guides and Handbook

Understanding Meshery Models

Contributing to Meshery Models

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