`Inline` fails on a recursive schema file shared through a response file: `reference ... not found in analysis phase`
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #288 de @TristanSpeakEasy — fusionado
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go, openapi
- Área
- backend-api-design
Línea de trabajo
Start by tracing openapi.Inline and the nested reference analysis for external response and schema files; the report does not name implementation or test files. Reproduce with the three operations and recursive Folder.yaml schema, then compare with two operations and a single-file document. Done when the three-operation case inlines successfully for OpenAPI 3.0.3 and 3.1.0, with the recursive reference targeting #/components/schemas/__Folder_yaml.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
openapi.Inline (and openapi spec inline) fails when a self-referencing schema in its own file is reached through a response file that three or more operations reference. With two operations it inlines fine, and so does the same document written in one file.
Reproduction
openapi.yaml:
openapi: 3.0.3
info: {title: t, version: "1"}
paths:
/f1:
get:
responses:
"200": {$ref: ./responses/folder.yaml}
/f2:
get:
responses:
"200": {$ref: ./responses/folder.yaml}
/f3:
get:
responses:
"200": {$ref: ./responses/folder.yaml}
responses/folder.yaml:
description: ok
content: {application/json: {schema: {$ref: ../schemas/Folder.yaml}}}
schemas/Folder.yaml:
properties:
parents:
items: {$ref: ./Folder.yaml}
$ openapi spec inline openapi.yaml
Processing OpenAPI document: openapi.yaml
Error: failed to inline OpenAPI document: failed to inline references: failed to inline nested references in : failed to inline schemas: failed to inline schema: failed to inline schema: reference schemas/Folder.yaml#/components/schemas/__Folder_yaml not found in analysis phase
The library call (openapi.Unmarshal, then openapi.Inline with ResolveOptions{RootDocument: doc, TargetLocation: <absolute path>} and RemoveUnusedComponents: true) returns the same error.
Expected result
The document is inlined, as it is with /f3 removed: each response gets the Folder schema and the recursive ref points at #/components/schemas/__Folder_yaml. The same three operations also inline when they reference ./schemas/Folder.yaml directly, or when the response and the schema are in the root's components (one file).
Actual result
The error above, for openapi: 3.0.3 and 3.1.0 alike, and with four operations too. The reference it can't find, #/components/schemas/__Folder_yaml, is the name the inliner itself gives the recursive schema, here resolved against schemas/Folder.yaml.
Version
v1.26.0 (also main, d269643). CLI from go install github.com/speakeasy-api/openapi/cmd/openapi@latest (v0.0.0-20261016011534-d2696438ec74).
- Lenguaje dominante
- Go
- Estrellas
- 276
- Forks
- 21
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 20
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de speakeasy-api/openapi
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
speakeasy-api/openapi#289 ·
Los mantenedores suelen responder en 1 día
-
`openapi spec lint --fix` drops node-level fixes and can duplicate pathsPosiblemente ocupada @RaphaelFakhri la tomó hace 5 días. Abierto
Dificultad 4/5 1-2 días Aptitud para principiantes 35/100
speakeasy-api/openapi#280 ·
Los mantenedores suelen responder en 1 día
Todos los issues de speakeasy-api/openapi
Issues similares
-
Object Manager 1.13 resets a vCLU after sending a projectPosiblemente ocupada @tciunelis la tomó hoy. Abiertobug ready ticket
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Domktorymysli/vclu#152 ·
Los mantenedores suelen responder en 1 día
-
bug converter
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
grafana/sigma-rule-deployment#435 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
🤖 verification skills: harden check.sh and verify.sh argument and file handling (#391 follow-ups)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google/go-containerregistry#2491 ·
Los mantenedores suelen responder en 1 día