Closed hfloyd closed 1 year ago
My thinking here was that if you don't need to add any information for an entry, you just omit it. But if you do, there should be at least one item or there's no point in having it in the file.
So here you can just omit the AddOnPackagesRequiredForUmbracoCloud
entry if you don't have anything to add.
However now you point it out, I don't see there's any harm in having an empty array set here, so I'll remove the minItems
setting.
Thanks, @AndyButland , I am dynamically generating the JSON, and using a Data model which is then serialized, so it's a bit trickier to just "exclude" the generation of that JSON property if it's empty. π
JSON.net can be a little annoying regarding empty arrays and lists. For my own models, I ended up adding these methods (which JSON.net listens for):
Not exactly the prettiest solution (the methods have to be public), but it does the job.
Updating the schema to allow zero-length arrays sounds like a good solution π
I see that an empty array now validates, thanks, @AndyButland ! My file still isn't getting picked for some reason... π’ But I'm out of ideas.
@hfloyd if you want to point me to your JSON file, I can have a look.
That would be so kind of you, @nathanwoulfe . Take a look here: https://dragonflylibraries.com/umbraco-marketplace-dragonfly.umbraco10.schemaimporter.json for NuGet package https://www.nuget.org/packages/Dragonfly.Umbraco10.SchemaImporter/
I ran this import locally to check, and found it was tripping up on a duplicate value provided in the AlternatePackageNames
collection (which fails on import due to a unique constraint). I'll amend the importer to de-duplicate here.
Looks to be presented now: https://marketplace.umbraco.com/package/dragonfly.umbraco10.schemaimporter
Thanks so much! It looks greatπ Now I've got to update all my other packages π
This is in the schema for the marketplace json:
But it seems to me that the majority of packages will not require any Umbraco Cloud add-on package... My file fails schema validation if I have this:
"AddOnPackagesRequiredForUmbracoCloud": [],
But I feel this should be a valid entry....
If I update it to:
It passes validation, but since "NONE" is not a valid package ID, I'm not sure that is really what you want to be getting...