-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
The JSON property name for 'Schema.NET.IHospital.OpeningHours' collides with another property. #603
Comments
Hi @fewless2019 - I can't recreate the problem you've describe by using the steps you've mentioned. Can you tell me the version of .NET you're using, whether you're pulling in your own version of System.Text.Json (and what version that is), and also have a look over the steps to reproduce that you've provided. Based on the exception message, I don't think the problem is to do with the The strange part though is these combined types have several properties that are overridden, not just |
we are using .net 6
attattachedatched is the Json that produces the error.
I am a bit lost.
We use Schema.NET.MedicalWebPage
then we fill out the info for the Schema.NET.Physician nothing to do with the hospital. is even included when we go to serialize this.
how ever when i used Schema.NET.Person instead of Schema.NET.Physician it works fine.
Thanks,
David Fewless
Senior Web Developer, Diagram
[A close-up of a clock Description automatically generated with medium confidence]
e: ***@***.******@***.***>
p: 630-491-2622
w: www.wearediagram.com<http://www.wearediagram.com/>
he/him
[cid:c0afc9ac-d344-4d09-bfe9-33d4e05546a9] <https://twitter.com/wearediagram> [cid:54944cde-315f-4968-a540-0571ae6566b1] <https://www.linkedin.com/company/19151275/admin/> [cid:22682a1f-e095-42d0-991e-71db8b4a0d15] <https://www.instagram.com/heydiagram>
…________________________________
From: James Turner ***@***.***>
Sent: Thursday, June 8, 2023 9:23 AM
To: RehanSaeed/Schema.NET ***@***.***>
Cc: David Fewless ***@***.***>; Mention ***@***.***>
Subject: Re: [RehanSaeed/Schema.NET] The JSON property name for 'Schema.NET.IHospital.OpeningHours' collides with another property. (Issue #603)
Hi @fewless2019<https://github.com/fewless2019> - I can't recreate the problem you've describe by using the steps you've mentioned. Can you tell me the version of .NET you're using, whether you're pulling in your own version of System.Text.Json (and what version that is), and also have a look over the steps to reproduce that you've provided.
Based on the exception message, I don't think the problem is to do with the Physician inheritance but the Hospital inheritance. Specifically CivicStructureAndEmergencyServiceAndMedicalOrganization has OpeningHours and so does LocalBusinessAndOrganizationAndPlace. And even then, the exception refers to the interface IHospital, not the implementation.
The strange part though is these combined types have several properties that are overridden, not just OpeningHours and I don't see anything special about OpeningHours in terms of how it is defined in Schema.NET nor any reference in your steps to reproduce.
—
Reply to this email directly, view it on GitHub<#603 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWNF4UCUY64AQXNVILFGCCLXKHG33ANCNFSM6AAAAAAY4VGQEU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
We are using .Net6
Attached is the Json.
I fixed this by creating my own physician class and removing the hospital affiliation variable.
///// <summary>
///// A hospital with which the physician or office is affiliated.
///// </summary>
//[JsonPropertyName("hospitalAffiliation")]
//[JsonPropertyOrder(407)]
//[JsonConverter(typeof(ValuesJsonConverter))]
//public OneOrMany<IHospital> HospitalAffiliation { get; set; }
Thanks,
David Fewless
Senior Web Developer, Diagram
[A close-up of a clock Description automatically generated with medium confidence]
e: ***@***.******@***.***>
p: 630-491-2622
w: www.wearediagram.com<http://www.wearediagram.com/>
he/him
***@***.*** <https://twitter.com/wearediagram> ***@***.*** <https://www.linkedin.com/company/19151275/admin/> ***@***.*** <https://www.instagram.com/heydiagram>
From: James Turner ***@***.***>
Sent: Thursday, June 8, 2023 9:23 AM
To: RehanSaeed/Schema.NET ***@***.***>
Cc: David Fewless ***@***.***>; Mention ***@***.***>
Subject: Re: [RehanSaeed/Schema.NET] The JSON property name for 'Schema.NET.IHospital.OpeningHours' collides with another property. (Issue #603)
Hi @fewless2019<https://github.com/fewless2019> - I can't recreate the problem you've describe by using the steps you've mentioned. Can you tell me the version of .NET you're using, whether you're pulling in your own version of System.Text.Json (and what version that is), and also have a look over the steps to reproduce that you've provided.
Based on the exception message, I don't think the problem is to do with the Physician inheritance but the Hospital inheritance. Specifically CivicStructureAndEmergencyServiceAndMedicalOrganization has OpeningHours and so does LocalBusinessAndOrganizationAndPlace. And even then, the exception refers to the interface IHospital, not the implementation.
The strange part though is these combined types have several properties that are overridden, not just OpeningHours and I don't see anything special about OpeningHours in terms of how it is defined in Schema.NET nor any reference in your steps to reproduce.
—
Reply to this email directly, view it on GitHub<#603 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWNF4UCUY64AQXNVILFGCCLXKHG33ANCNFSM6AAAAAAY4VGQEU>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Just ran across this issue, since I saw a similar issue serializing 'MedicalStudy'. I'm getting this error: This is using .NET 8.0 version of System.Text.Json. |
Looks like my serialization issue was due to 'Drug' being a subclass of both Product and Substance, and the 'Funding' property is defined in both places. Not sure how Schema.NET is supposed to handle these kinds of situations? I had to create a private version of the library, and remove 'Product' from the JSON-LD file to get it working. cc: @Turnerj @RehanSaeed |
Describe the bug
Can not serialize a schema.net.Physician while using schema.net.MedicalWebPage
Properties with the same name.
hospital ->CivicStructureAndEmergencyServiceAndMedicalOrganization ->
Physician-> MedicalBusinessAndMedicalOrganization -> LocalBusinessAndOrganization ->
Steps to reproduce
Stack trace
Properties with the same Name
hospital ->CivicStructureAndEmergencyServiceAndMedicalOrganization ->
Physician-> MedicalBusinessAndMedicalOrganization -> LocalBusinessAndOrganization ->
Expected behaviour
Unique names and ability to serialize.
Schema objects
schema.net.Physician
schema.net.MedicalWebPage
The text was updated successfully, but these errors were encountered: