The problem is that trying to parse an int succeeded for the unquoted string http://example.com (parsed as the number 0), which caused issues when using an "AnyCodable" approach.
This PR makes the parsing stricter, so that a URL like above does not successfully parse as an int, and allows "AnyCodable" wrappers to only successfully parse the value as a string.
Test Plan
Added a unit test both for the positive and negative cases.
Summary
I believe this fixes https://github.com/jpsim/Yams/issues/337, which I also just hit.
The problem is that trying to parse an int succeeded for the unquoted string
http://example.com
(parsed as the number0
), which caused issues when using an "AnyCodable" approach.This PR makes the parsing stricter, so that a URL like above does not successfully parse as an int, and allows "AnyCodable" wrappers to only successfully parse the value as a string.
Test Plan
Added a unit test both for the positive and negative cases.