[Bug]: json-xml-mediator policy turns XML text that looks like a number into a JSON number
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 53/100
Direzione di ricerca
Start by locating the json-xml-mediator policy implementation and its XML-to-JSON conversion tests; the issue does not name specific files. Trace where XML text values are trimmed and inferred as numbers or booleans, then check how the policy documentation's Example 1 represents string values. Done means XML text such as 02134 and 1.10 reaches the client unchanged as JSON strings for both backend responses and XML requests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
When the policy converts XML to JSON, it guesses a type for each text value. Text that parses as a number becomes a JSON number, and true and false become booleans. Surrounding whitespace is trimmed first.
XML text has no type, so the guess loses data. Leading zeros and trailing zeros disappear. A ZIP code 02134 becomes 2134, and a version 1.10 becomes 1.1. This applies to backend responses and to XML requests alike.
The policy documentation does not describe the guess. Its Example 1 shows an order ID kept as the string "12345".
Expected Behaviour
Text reaches the client unchanged, as a JSON string: {"order":{"version":"1.10","zip":"02134"}}.
Actual Behaviour
The client receives {"order":{"version":1.1,"zip":2134}}.
Steps to Reproduce
- Create a REST API with the policy on a POST operation:
{"name":"json-xml-mediator","version":"v1","params":{"downsteamPayloadFormat":"json","upstreamPayloadFormat":"xml"}} - Have the backend answer
application/xmlwith<order><zip>02134</zip><version>1.10</version></order>. - Send
{"sku":"W-1"}withContent-Type: application/json. The client receives{"order":{"version":1.1,"zip":2134}}.
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 scripted to answer the XML above
- Lingua principale
- Go
- Stelle
- 85
- Fork
- 142
- Merge medio
- 1g 7h
- PR unite (30g)
- 255
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wso2/api-platform
-
Area/Policies Aspect/API Severity/Major Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
wso2/api-platform#4468 ·
I maintainer di solito rispondono entro 1 giorno
-
Area/Policies Aspect/API Severity/Major Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
wso2/api-platform#4465 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Invalid [api_portal.http_client.tls] value reports an error naming server.httpsForse già presa @Maheesh09 l’ha presa 1 giorno fa. ApertaArea/DeveloperPortal Aspect/Configuration Severity/Minor Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
wso2/api-platform#4437 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
wso2/api-platform#4369 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsApertaArea/Policies Aspect/Other Severity/Trivial Type/Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
wso2/api-platform#4355 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wso2/api-platform
Issue simili
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentForse già presa @cvas22 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
influxdata/telegraf#20264 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameApertaaccepted bug wg/enterprise-environment
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vllm-project/semantic-router#7483 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
stacklok/toolhive-catalog#2076 ·
I maintainer di solito rispondono entro 1 giorno
-
vulncheck or vulndb
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
golang/go#83428 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gke-labs/kube-agents#7441 ·
I maintainer di solito rispondono entro 1 giorno