RehanSaeed / Schema.NET

Schema.org objects turned into strongly typed C# POCO classes for use in .NET. All classes can be serialized into JSON/JSON-LD and XML, typically used to represent structured data in the head section of html page.
MIT License
640 stars 80 forks source link

ICreativeWork.Provider doesn't exist in 13.0.0 package #682

Closed kirk-marple closed 8 months ago

kirk-marple commented 8 months ago

Describe the bug

I just tried upgrading to 13.0.0, and it looks like ICreativeWork.Provider is gone.

Seems like it's still in the schema: https://schema.org/CreativeWork

Steps to reproduce

Reference ICreativeWork.Provider, and upgrade to 13.0.0.

Expected behaviour

ICreativeWork.Provider to still exist.

Schema objects

https://schema.org/CreativeWork

Turnerj commented 8 months ago

Hey @kirk-marple - for whatever reason, schema.org marked that property as new so it is only generated in the Schema.NET.Pending package. You should be able to switch to that for access to the property again.

https://schema.org/provider

kirk-marple commented 8 months ago

Hey @kirk-marple - for whatever reason, schema.org marked that property as new so it is only generated in the Schema.NET.Pending package. You should be able to switch to that for access to the property again.

https://schema.org/provider

Oh that's super weird. I've been using it for years. Thanks for letting me know.

I'll try the Pending package to add it back.

kirk-marple commented 8 months ago

Unfortunately, since we're serializing the type/assembly in JSON, we can't move off Schema.NET package to Schema.NET.Pending, or it breaks existing data.

We have to stay on 11.x for now, until I can migrate data to not use Provider property any longer.

Happen to know when that change was made @Turnerj? I looked at the Schema.org issues, and can't find when they decided that.

SmithPlatts commented 8 months ago

Having a dig through changsets, it was between Schema.org versions 13 and 14 that provider was moved to pending.schema.org, when it was added to Action.

Schema.NET versions up to and including 12 were using an older version of the schema, which didn't have it as pending; the new version 13 uses a much more up to date version (was it 23 @Turnerj?) which is why the change has occurred.

Turnerj commented 8 months ago

Yeah, that sounds about right. It is difficult to pin down what versions of schema.org we were generating from in the older versions (even now we can only rely on whatever commit message is used when updating). I really wish the JSON files we download and use from schema.org actually could indicate what the version was - I would actually then surface it as a constant in the package.

And yep, Schema.NET v13 is using schema.org v23.

Now @kirk-marple , are you using the serializer that ships with Schema.NET for JSON? If so it shouldn't be doing the assembly as part of the @type property.

kirk-marple commented 7 months ago

@Turnerj Forgot to comment about the serializer. I didn't even know that existed before. I've moved over to that now, and that makes serialization a lot easier, thanks! I'd just been using Newtonsoft directly before, but now this makes our persistent JSON a lot cleaner, and should let us use the Pending package - still need to try that out.