Skip to content
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

Support JSON Schema Draft v6 & v7 #574

Open
wstaelens opened this issue Nov 30, 2017 · 7 comments
Open

Support JSON Schema Draft v6 & v7 #574

wstaelens opened this issue Nov 30, 2017 · 7 comments

Comments

@wstaelens
Copy link

@wstaelens wstaelens commented Nov 30, 2017

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

Tasks v6:

  • "id" replaced by "$id"
  • "exclusiveMinimum" and "exclusiveMaximum"
  • booleans as schemas | allowable anywhere, not just "additionalProperties" and "additionalItems"
  • "propertyNames" | added
  • "contains" | added
  • "const" | added
  • "required" | allows an empty array
  • "dependencies" | allows an empty array for property dependencies
  • "format": "uri-reference"
  • "format": "uri-template"
  • "format": "json-pointer"
  • "examples" added

Tasks v7:

  • "$comment" | added to Core
  • "if", "then", "else"
  • "readOnly"
  • "writeOnly"
  • "contentMediaType"
  • "contentEncoding"
  • New format strings
@RicoSuter
Copy link
Owner

@RicoSuter RicoSuter commented Nov 30, 2017

What is new/missing?

@Indigo744
Copy link

@Indigo744 Indigo744 commented Sep 24, 2019

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.

@RicoSuter RicoSuter mentioned this issue Nov 21, 2019
0 of 2 tasks complete
@canpolat
Copy link

@canpolat canpolat commented Apr 17, 2020

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
Copy link
Owner

@RicoSuter RicoSuter commented Apr 18, 2020

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
Copy link

@canpolat canpolat commented Apr 18, 2020

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
Copy link
Owner

@RicoSuter RicoSuter commented May 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.