[Bug]: json-xml-mediator policy accepts XML with more than one root element
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go, json, xml
- Área
- backend-api-design
Línea de trabajo
Empieza en la ruta de análisis XML de la política json-xml-mediator, donde el issue indica que xml.Unmarshal lee el primer elemento e ignora el contenido restante. Revisa las pruebas de la política para XML malformado y añade cobertura para un documento con dos elementos raíz. Se considera terminado cuando esa solicitud devuelve 500 y no se reenvía al backend.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
The policy parses XML with xml.Unmarshal, which reads the first element and stops. Anything after that element is ignored.
So a document with two root elements is not well-formed, yet it passes. The policy converts the first element, drops the rest and forwards the result. The backend never learns that part of the request was lost.
Malformed XML that fails inside the first element is rejected with 500, as the policy documentation describes for malformed payloads.
Expected Behaviour
The request is rejected with 500 and does not reach the backend.
Actual Behaviour
The gateway answers 200. The backend receives {"order":{"sku":"W-1"}}, and the second <order> is lost.
Steps to Reproduce
- Create a REST API with the policy on a POST operation:
{"name":"json-xml-mediator","version":"v1","params":{"downsteamPayloadFormat":"xml","upstreamPayloadFormat":"json"}} - Send
<order><sku>W-1</sku></orders>withContent-Type: application/xml. The gateway answers 500, and the backend is not called. - Send
<order><sku>W-1</sku></order><order><sku>G-2</sku></order>. The gateway answers 200, and the backend receives{"order":{"sku":"W-1"}}.
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
- Gateway versions: 1.1.0, 1.2.0 and latest
- Policy:
json-xml-mediatorv1.1.0, wso2/gateway-controllers main5b8e3367 - Upstream: a test service that records the request body
- Lenguaje dominante
- Go
- Estrellas
- 85
- Forks
- 142
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 250
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
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 wso2/api-platform
-
Area/Policies Aspect/API Severity/Major Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wso2/api-platform#4465 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Invalid [api_portal.http_client.tls] value reports an error naming server.httpsPosiblemente ocupada @Maheesh09 la tomó hoy. AbiertoArea/DeveloperPortal Aspect/Configuration Severity/Minor Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wso2/api-platform#4437 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
wso2/api-platform#4369 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsAbiertoArea/Policies Aspect/Other Severity/Trivial Type/Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
wso2/api-platform#4355 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: A refused request's analytics event and traffic log lose the path the client calledQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. AbiertoArea/Gateway Aspect/API Severity/Minor Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wso2/api-platform#4348 ·
Los mantenedores suelen responder en 1 día
Todos los issues de wso2/api-platform
Issues similares
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outPosiblemente ocupada @anoop2811 la tomó hoy. Abiertoneeds-triage type/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
1lck/Lithe-IDEA#2432 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
dsx-ai-factory/health-validation#368 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
keyxmakerx/Chronicle#2824 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día