Skip to content

surfer: Abstract naming and casing logic in model #3414

@quirogas

Description

@quirogas

Currently, casing transformations (e.g., strcase.ToKebab, strcase.ToSnake) are performed at the last minute within the builder logic. This can lead to inconsistencies and makes the logic harder to trace.

Context & Rationale

  • Maintainability: Scattered casing logic is fragile. If a naming convention changes, it must be updated in multiple places.
  • Precedent: Reviewers noted this was a "mistake made in gen_sfc" and should be avoided by abstracting casing into the model.
  • Sidekick vs Surfer: We need to determine if these transformations belong in the core sidekick/api model (affecting all generators) or a Surfer-specific internal model.

Implementation Considerations

Proposed Solution

  • Research the impact of adding gcloud-specific naming properties to the sidekick API model.
  • Alternatively, implement a transformation layer in Surfer that populates an internal model with pre-cased names.

Relevant files

  • internal/surfer/gcloud/builder.go
  • internal/sidekick/api/model.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    surferIssues related to the surfer project (https://github.com/googleapis/librarian/issues/2375)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions