Unify Handling of allOf/anyOf and oneOf in Diff logic
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Comece por SchemaDiff#resolveComposedSchema e SchemaDiff#addSchema para entender como allOf/anyOf são achatados e, em seguida, leia ComposedSchemaDiffResult#diff e ChangedOneOfSchema para conhecer a comparação existente de oneOf. Defina como adições, remoções e modificações estruturais em allOf/anyOf devem aparecer junto às alterações de propriedades achatadas; considera-se concluído quando o diff relata as alterações de composição de forma consistente sem perder detalhes relevantes.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Current Behavior:
The diffing mechanism currently handles allOf/anyOf and oneOf differently within composed schemas:
-
allOf/anyOf: These schemas are recursively resolved and their properties are merged into the parent schema before the main diffing occurs. This happens inSchemaDiff#resolveComposedSchema, where properties fromallOf/anyOfsubschemas are added to the parent usingSchemaDiff#addSchema. The originalallOf/anyOfstructure is effectively flattened. -
oneOf: These schemas are not merged beforehand. Instead, theComposedSchemaDiffResult#diffmethod performs a structural comparison of theoneOflists between the old and new schemas. It identifies added, removed, or changedoneOfoptions, storing the results in aChangedOneOfSchemaobject which is then attached to theChangedSchema.
Suggested Behavior:
This difference in processing leads to an inconsistency. While the merging for allOf/anyOf simplifies property comparison later, it loses the structural information about changes within the allOf/anyOf lists. Conversely, oneOf retains this structural information because it's crucial for understanding changes in available options.
Consider unifying the approach. Perhaps allOf/anyOf could also be compared structurally, similar to oneOf, to provide a more consistent and potentially more informative diff result regarding the composition itself, rather than just the flattened outcome. This would allow tracking additions, removals, or modifications within allOf/anyOf lists directly.
- Linguagem predominante
- Java
- Estrelas
- 1.1k
- Forks
- 190
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de OpenAPITools/openapi-diff
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
OpenAPITools/openapi-diff#506 ·
-
good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
OpenAPITools/openapi-diff#364 ·
-
bug OpenAP 3.1.0 Support
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
OpenAPITools/openapi-diff#910 · 1 comentário ·
-
Render capabilities
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
OpenAPITools/openapi-diff#893 · 1 comentário ·
-
Breaking/Non-Breaking classification
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
OpenAPITools/openapi-diff#886 ·
Todas as issues de OpenAPITools/openapi-diff
Issues semelhantes
-
certification
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 80/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Abertabug ecr
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Needs: Triage Type: Feature request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
github/copilot-sdk#2760 ·