It's "fine" is you ignore adversarial situations.
If someone is taking malicious stabs at your API then you have a problem
If someone is taking malicious stabs at your API then you have a problem
What good is a perfect linear-time constant-space parser if the next thing the system does is to allocate hundreds of megabytes of objects representing some deserialized data structure?
The parser is usually the least interesting part.