RicoSuter / NJsonSchema

JSON Schema reader, generator and validator for .NET
http://NJsonSchema.org
MIT License
1.4k stars 535 forks source link

Support JSON Schema Draft v6 & v7 #574

Open wstaelens opened 6 years ago

wstaelens commented 6 years ago

(+ update: http://json-schema.org/implementations.html#validator-dotnet ;-) )

Tasks v6:

Tasks v7:

RicoSuter commented 6 years ago

What is new/missing?

wstaelens commented 6 years ago

v7: http://json-schema.org/draft-07/json-schema-release-notes.html v6: http://json-schema.org/draft-06/json-schema-migration-faq.html

etc...

Indigo744 commented 5 years ago

Note that contentEncoding: "base64" (RFC ref) could be redundant with (or contradict) format field (like byte).

I'm not sure how this case should be handled.

canpolat commented 4 years ago

I was looking for writeOnly support when I found this issue. I wonder if [DataType(DataType.Password)] would somewhat fit the spec for that one?

RicoSuter commented 4 years ago

It’s probably a bit too specific and probably better if you implement an own schema processor which handles that according to your needs.

canpolat commented 4 years ago

When you say "it's probably too specific" do you mean "writeOnly" or "password"? If I understand the spec correctly, "writeOnly" is part of the latest draft (haven't checked earlier versions but according to this issue it seems to be part of v7 too). If you mean "password", I don't really need it; I just wanted to bring it to your attention (it is part of System.ComponentModel.DataAnnotations). If you have plans for implementing "writeOnly" that would be cool. If it does not take a huge effort to get familiar with the repo, I might as well give it a go myself. Pointers would be appreciated.

RicoSuter commented 4 years ago

I think supporting the property in the model as bool? is fine but generating password as always writeOnly is a breaking change and might not be correct for everyone. A PR for the property is appreciated.