Skip to content

pathological naming schemes could create clashing structs #66

@clux

Description

@clux

Problem

suppose you have a struct endpoints in the schema with properties:

  • metrics_relabelings (generating EndpointsMetricsRelabelings struct)
  • metrics (generating EndpointsMetrics struct)

suppose further that the metrics property in the schema has further properties:

  • relabelings (generating EndpointsMetricsRelabelings struct - a second time!)

I.e. it is possible to have multiple ways to reach the same struct names, and kopium does not handle this (it will emit multiple structs with the same name).

Potential workarounds

  • use smaller modules (mod Endpoints { mod Metrics {... to create a namespace for each struct level
  • naming disambiguation at insert time (we have the full list of OutputStruct available when adding another)

Leaning towards the latter, even though it will likely just be us suffixing numbers (EndpointsMetricsRelabelings2) to the struct and hoping the users do manual disambiguation where possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions