Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make inferring types from strings optional for Yaml provider #114

Closed
alfonsogarciacaro opened this issue Mar 29, 2017 · 2 comments
Closed

Comments

@alfonsogarciacaro
Copy link

Hi there! We started to have problems with the YamlConfig provider in our project because we've lists where some items look and quack like Guids, so the provider infers the field type to be a Guid list, but we want to be able to put other plain strings in that list and the provider doesn't let us do that as it fails when it tries to cast everything into a guid. This affects also TimeSpan and Uri-looking strings.

I'd like to send a PR to make inferring types from strings optional. I gave it a shot at adding another static parameter to YamlConfig and using a mutable value in Parser (to avoid too much refactoring) but unfortunately it didn't work, and this solution would also be breaking (besides not very elegant) as it seems it's not possible to have optional static parameters.

So before sending a PR, I want to ask the maintainers if they can think of a good approach to this problem.

@vasily-kirichenko
Copy link
Contributor

Implemented in #115 and published in NuGet 1.0.0

image

@alfonsogarciacaro
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants