-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
One of our endpoints accepts XML and parses it into a JS object. Part of the data that it receives includes a zip code. It appears that this parser is seeing what looks like a number and converting it into an int even though zip codes should be treated as strings. Is there a way to disable the automatic parsing of values?
UPDATE: I tried setting the attribute parsing value to false but it seems to be completely ignoring the option.
fastifyServer.register(require('fastify-xml-body-parser'), {
parseAttributeValue: false,
})
Example Data:
<PostalCode>02108</PostalCode>
console.log(request.body); // { PostalCode: 2108 }
Metadata
Metadata
Assignees
Labels
No labels