Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Breaking change introduced by “Handle leading underscores in property names”

Aberta
#2,163 1 comentário 1 reação 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
go

Direção de pesquisa

Review the PR #1822 that introduced the change. Examine the code generation logic, likely in the package handling property name transformation. Understand the breaking change's impact on existing generated structs. Determine if a flag, conditional logic, or versioning strategy is needed to restore backward compatibility.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

I believe the recent change to handle leading underscores in property names has introduced a breaking change in how the oapi-codegen generates structs. https://github.com/oapi-codegen/oapi-codegen/pull/1822

This renaming alters the generated code and breaks existing code that relies on the previous field names. While I understand the goal of avoiding duplicate names, this change modifies the generated code and therefore should be considered a breaking change.

Additionally, it exposes implementation details of the OpenAPI spec (like the underscore prefix) into the generated Go code, which can be undesirable when consumers expect normalized field names.

What I expected

The generated field names to stay consistent with previous behavior, or at least a clear note that this change breaks compatibility (e.g. via a major version bump or release note).

What happened

The generated code now prefixes fields with Underscore, breaking compatibility with previously generated code.

Suggestions

Maybe this behavior could be:

  • Behind a flag, or
  • Only enforced when duplicate fields are present, or
  • Called out clearly in the changelog or release notes if it’s meant to be permanent
Linguagem predominante
Go
Estrelas
8.6k
Forks
1.1k
Merge médio
14h 45min
PRs com merge (30d)
29

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de oapi-codegen/oapi-codegen

Todas as issues de oapi-codegen/oapi-codegen

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.