-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
public List<string> operators { get; set; } is causing validation errors #60
Comments
Looks correct to me, can you post exception details? |
You have a validation error in the |
Clarification: JSON Schema does not know dictionaries. The schema describes an object which can have any properties (i.e. the dictionary keys) of type object (i.e. the dictionary values)... Because the property is nullable, its JSON Schema type can be |
Ok, I see the problem. Probably the .NET |
The reason it can be null or object is that I didn't make it required. If it is Null, I get no errors, I only get errors when I populate it with key:value pairs as an object. |
I have to implement a Unit Test... I'll report back... |
Ok. Thanks! |
According to http://jsonschemalint.com/draft4/ the JSON Schema validation is correct for the given data: So we have to change the JSON Schema generator... |
I've added the following unit test:
Is this correct? |
Commit: 6406618 |
v2.11 now available via NuGet, please try with this version and report if it works... |
Sorry it took a while to get back with you on this. Yes, this fixed the issue and now dictionary works correctly. |
Nice. Thx for reporting the issue and using the library... |
I'm generating a json schema from a class and everything works except:
public Dictionary<string, object> values { get; set; }
.For some reason it converts it to:
"values": { "type": [ "null", "object" ], "additionalProperties": { "type": "object" } },
.What the json should look like is this:
"values": { "employee Only": "Employee Only", "employee and Spouse": "Employee and Spouse", "employee and Children": "Employee and Children", "employee and Family": "Employee and Family" }
This is causing an error to be thrown when it shouldn't.
If you want me to post the fully convert Json Schema, I can but it is quite long. Hopefully this makes sense. I'm thinking the "additionalProperties" is what is causing the error. Am I doing something wrong maybe?
The text was updated successfully, but these errors were encountered: