Chocolatey extends the NuGet file format .nuspec based XML files as base for their packages with at the time of writing very sparse and limited documentation in what it extends, why it does that and what extra limitations it imposes on the fields used inside .nuspec files.
Hopefully by now that has improved, so this post is a reminder to myself to check that out eventually.
At the time of writing, the NuGet .nuspec documentation was at [Wayback/Archive] .nuspec File Reference for NuGet | Microsoft Learn and the file format at [Wayback/Archive] NuGet.Client/nuspec.xsd at dev · NuGet/NuGet.Client. Most fields are defined as primitive data types xs:boolean, xs:string and xs:anyURI (of the 19 available primitive XML SChema (W3C) types). Some composite data types are are composed from them using local and global complexType, most using xs:all, xs:attribute or single-type unbounded xs:sequence (which all imply no particular order).
Since an XML Schema allows to both use restriction and extension on data types (the eXtensible in XML!), making them more strict is a relatively straight-forward operation and has the benefit of having these in a central place.
In the past for more than 5 years [Wayback/Archive] Is there a specification for the package format? · Issue #379 · chocolatey/choco was just pointing to the NuGet .nuspec format, but after a request to re-open new comments were made pointing to a current issue (basically a stub, but still) and a Chocolatey nuspec.xsd file, yay!
Still it was a quest to figure out the additional rules they have added, especially since the documentation was sparse and sloppy.
Read the rest of this entry »