Is Newtonsoft.Json.Schema.JsonSchema out of date?

I am trying to create a Json string validation method using a Json schema using this method: http://www.newtonsoft.com/json/help/html/JsonSchema.htm

It says that the object is deprecated and moved to its own package, so I use NuGet and install the package ( Newtonsoft.Json.dll and Newtonsoft.Json.Schema.dll are links) and have:

 using Newtonsoft.Json.Schema; using Newtonsoft.Json.Linq; public bool validateSchema(string _Json) { JsonSchema schema = JsonSchema.Parse( @"{ 'properties': { [MySchemaHere] } "); JObject jobject = JObject.Parse(_Json); return jobject.IsValid(schema); } 

How to get rid of an outdated message? It seems to me that the code was transferred to another / dll package, but it is called / used in the same way, and somehow I refer to the outdated one? It seems like I'm missing something simple / obvious.

EDIT: Here is an image that may help.

http://i.imgur.com/PWwpGRx.png

+7
json c #
source share
2 answers

I finally just created a new project and copied / pasted their example, and I see my painfully obvious mistake that I was struggling with.

I have to use:

Jchema

and not

Jsoncheche

+8
source share

Are you sure you have this DLL ?, your problem seems to be that this JSON Schema check has been ported to its own package, check more here:

http://www.newtonsoft.com/json/help/html/N_Newtonsoft_Json_Schema.htm

Hope for this help

+1
source share

All Articles