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

Portable schema IDs cascade from the root document digest, so any root edit rotates every ID in generated output

Aberta
#117 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
68/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
julia, openapi

Direção de pesquisa

Comece em src/normalize.jl, em _portable_schema_ids, e rastreie como _content_digest, parent, pointer e keyword formam cada label. Preserve o tratamento existente dos sufixos de colisão, garantindo ao mesmo tempo que edições não relacionadas na raiz não alterem os external- IDs; os IDs devem continuar determinísticos e mudar quando o schema referenciado por eles mudar.

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

Descrição

Generated clients embed a _SCHEMA_RESOURCE_DATA table keyed by https://openapi.invalid/schema/.json. The labels are content-derived, and the derivation chains every label back to the root document's digest. The practical effect is that editing one field anywhere in the root spec rotates every schema ID in the generated package. So for every update in the schemas the changes are massive in the autogenerated code.

The source of this problem is here

src/normalize.jl, _portable_schema_ids:

labels = Dict{Resources.ResourceId,String}(
primary.id => "root-" * first(_content_digest(primary.contents), 20),
)
...
seed = parent * "|" * pointer * "|" * keyword
labels[target] = "external-" * first(bytes2hex(SHA.sha256(seed)), 20)

_content_digest is sha256 over the canonical JSON of the whole root document, so it covers info.version, info.description, and every unrelated part of the spec.

Each external- label is then seeded on its parent label, which is the root label for first-level references and another derived label deeper down. So the root digest propagates transitively into every ID in the graph.

The fix entails decoupleing each label from the root digest, so an ID changes only when that schema changes:

  • Seed external- labels on the target resource's own _content_digest, rather than on the parent label. Collisions already have handling via the -2, -3 suffix loop in the remaining branch just below.
  • Or seed on the structural reference path from a stable root identifier (for example the spec's info.title) instead of the root's content hash.

Either keeps IDs stable under unrelated root edits while preserving determinism and uniqueness.

Linguagem predominante
Julia
Estrelas
56
Forks
16
Merge médio
1d 51min
PRs com merge (30d)
12

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

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 JuliaComputing/OpenAPI.jl

Todas as issues de JuliaComputing/OpenAPI.jl

Issues semelhantes

Mais issues de Julia

Receba novas issues na sua caixa de entrada

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