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

NetJSON RFC JSON types #46

Open
mitar opened this issue Mar 21, 2016 · 2 comments
Open

NetJSON RFC JSON types #46

mitar opened this issue Mar 21, 2016 · 2 comments
Labels
Milestone

Comments

@mitar
Copy link
Member

mitar commented Mar 21, 2016

Not sure if this is the best place to comment on the RFC, but I see that for key names there are only primitive JSON types specified. Wouldn't it be better if a JSON schema type with JSON schema formatter definition would also be specified?

And along the lines of #45, it would be great if a semantic URI of the key definition would be specified/defined. It would be great to have semantic schema definitions for network objects in the standard.

@nemesifier nemesifier added this to the Draft 0 milestone Mar 22, 2016
@nemesifier
Copy link
Member

For schema formatter definitions, do you mean things like:

{ "format": "ipv6" }

I'm currently working to implement this type of definition, I wrote down a note here:
openwisp/netjsonconfig#42

In the last few months I have usually worked on the spec with a bottom up approach: I tried implementing things first, and then chose the best approach between simplicity and expressiveness.

While implementing things (especially in the main netjsonconfig schema), and using existing implementations, I encountered a few issues that are pompting me to reconsider some initial ideas:

  • I'm thinking about publishing a reference NetJSON schema implementation separately from the RFC; It would serve as a reference implementation for others to use as a base to build their own schema; this will allow the NetJSON-Schema reference implementation to evolve faster than the prose RFC, which once published should evolve at a slower rate
  • formats in the current JSON-Schema v4 draft are not mandatory, so are not always implemented :-( - but I think it's a good idea to use them; we should also propose new formats like subnet (eg: 10.0.0.0/24) and network (eg: 192.168.5.24/23), but this will be a long term task

So 👍 for using formats (if I understood correctly) although I would prefer not to include the complete JSON-Schema in the RFC and just link to it.

Let me know what you think; I'd like to mark this as "accepted".

@mitar
Copy link
Member Author

mitar commented Jun 3, 2016

Yes, formatters is one (for strings). But maybe there are also other similar things. For example, for numeric values, we could define minimum and maximum values. Some values could be enums maybe. Things like that.

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

No branches or pull requests

2 participants