-
Notifications
You must be signed in to change notification settings - Fork 79
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
[0.4.8] object attributes are now case sensitive (breaking change!) #156
Comments
Might be related: PowerShell/PowerShell#19928 |
My apologies for the issues you're having with powershell-yaml. I was hoping that the 4 months we had the pre release up would be enough to catch things like this. But I did not take into account that not many people try out pre-releases. I will have a look this evening at options to mitigate this short term and will probably push an update. I am currently traveling so this will happen tomorrow at the latest. The case insensitivity when deserializing was broken behavior in previous versions. It essentially broke round-tripping as yaml itself is case sensitive. So after reading from yaml, you would loose keys as For the short term I will probably revert that change until after the holidays and release a 0.5 version with case sensitivity enabled. If this breaks things badly for you, and can't wait a few hours, please explicitly use/install 0.4.7 for now by passing the -MaximumVersion flag to Install-Module ultil I get a chance to get to a PC. |
This is the PR that fixed the broken case insensitive behavior of powershell-yaml: https://github.com/cloudbase/powershell-yaml/pull/139/files. This PR was a bug fix, not a feature, which is why it was not released as part of a major version release. Relying on case insensitivity is something that should be avoided, especially if the source of the data that is being used, is case sensitive. I am reverting it for now and pushing a new version on Monday at the latest, but keep in mind, that we are now reverting to broken behavior which will lead to data loss under certain conditions: foo: "this is important data"
Foo: "this is equally important data, but different" In the above example, YAML is case sensitive. Any parser that deals with YAML must also be case sensitive. This change will be added back in version I encourage anyone that uses powershell-yaml to watch this repository for changes and please help test out pre-releases whenever they are available. Especially if those pre-releases have been up for a long time. I don't expect anyone to run a pre-release of I will also be creating github releases from now on, with a description of every change in that release. We will have at least one pre-release, which will also be published to the gallery. The pre-release will stay for at least 1 week, after which if no issues are reported with that pre-release, a final release will be cut. |
@gabriel-samfira
which also might be a solution and is backwards compatible. I'm also not happy about the case insensitive attributes, but it needs time to fix it :) |
I would love to implement something like that, but I don't think it's a good fit for powershell-yaml. If we are to change the way we deserialize, I think we're just going to go with something like this: Where we add the ability for the user to define a "model" into which we deserialize a yaml. So instead of adding numerous switches and options, we just let the user define the data structure they want to deserialize into. In any case, I will publish a new version with the revert later today. Please click on "watch" for this repo and if your project has a CI, please consider using adding the I will try to do a much better job in communicating changes that are part of new releases. Right now transparency from my side is abysmal, and I need to fix that. |
A new version has been released: https://www.powershellgallery.com/packages/powershell-yaml/0.4.9 A new release has been generated on GitHub: https://github.com/cloudbase/powershell-yaml/releases/tag/v0.4.9 Please test it out and let me know if all is well. |
Starting with 0.4.8 all object attributes are case sensitive but were case insensitive before
example yaml file:
code:
This is a breaking change in a minor or patch version, right before xmas is not a good time to introduce such changes 😔
The text was updated successfully, but these errors were encountered: