我设法通过JSON.net TypeNameHandling让我的自我修复.我使用RavenDB存储JSON格式的对象,并将JSON.net序列化程序的TypeNameHandling设置为true,以便处理我已有的继承结构.
我需要更改我正在存储的文档的命名空间,所以现在当它被反序列化时,它会抛出错误"在JSON中指定的错误解析类型",因为对JSON文档中的类型的引用不再存在.
是否有可能拦截Json反序列化以进行某种滚动迁移?
谢谢,
我正在尝试对以下类结构进行建模,其中PersonDetails使用表拆分的拥有实体即 db 模式中没有名为的表PersonDetails
我正在使用实体框架核心 2.2
public class Person
{
public long Id { get; set; }
public PersonDetails Details { get; set; }
}
public class PersonDetails
{
public IReadOnlyCollection<Address> Addresses { get; set; }
public IReadOnlyCollection<Contact> Contacts { get; set; }
}
public class Address
{
public string Street { get; set; }
public string Suburb { get; set; }
}
public class Contact
{
public string PhoneNumber { get; set; }
public string EmailAddress { …Run Code Online (Sandbox Code Playgroud) I can't seem to figure out why swagger validation is failing
What is strange is that if I add more than one path the validation only complains about the last one. Then if I remove the last one it starts complaining about the one above it.
在swagger编辑器中工作时,一切似乎都可以验证。
招摇的文件如下:
{
"swagger":"2.0",
"info":{
"version":"0.0.1",
"title":"Bla API"
},
"schemes":[
"https"
],
"produces":[
"application/json"
],
"host":"rest.bla.com",
"basePath":"/api/v2/fleet",
"paths":{
"/{organisation_id}/access_groups":{
"get":{
"tags":[
"Access Group"
],
"summary":"Get access groups\n",
"description":"Gets a list of 'access_group' objects based …Run Code Online (Sandbox Code Playgroud)