0

I required a help on JSON schema and JSON validation where We have a requirement to have multiple attributes (built-in and custom) for a property in C# and then serialize them into JSON schema. I am able to create multiple custom attributes and serialize them using JSchemaGenerationProvider and also validate the same using JsonValidator in my application. I am using Newtonsoft JSON for this.

My queries are:

  1. When I generate the Schema and compare with JSON on any online, the custom attributes are ignored by the editor, is this because it is not aware of the custom attribute and also requires corresponding validator?
  2. Is there a way we can export the custom validators (something like a plugin) so that any 3rd party tools can use it to validate custom attributes?
  3. How we can develop a custom attribute just like a RangeAttribute which can be validated by any 3rd party JSON Schema validator tool.
  4. Some attributes like Editable, Readonly cannot be serialized into JSON schema, why?

Thanks.

Regards, Shivu.

5
  • Can you share what library you're using, please? I can tell this isn't mine (JsonSchema.Net.Generation), but I don't know which one it is. Commented Mar 7, 2024 at 21:26
  • @gregsdennis: Sorry for the wrong tagging, we are using Newtonsoft Json. Commented Mar 8, 2024 at 8:28
  • please provide some examples , classes, what to expect etc... Commented Mar 8, 2024 at 14:57
  • stackoverflow.com/questions/36344961/… Commented Mar 11, 2024 at 17:35
  • @gregsdennis: Please can you clarify If I need to use JsonSchema.net and JsonSchema.net.Generation for Schema generation targeting .Net Framework 4.5.1, is it possible? I need to generate the schemas directly from C# classes and also customize the schema generation based on grouping of properties using the category attribute and validating generated schemas with JSON data. Commented Mar 15, 2024 at 6:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.