Google Groups

RE: [json-schema] Re: JSON Schema Generator - alpha version available


sergey Apr 23, 2012 2:59 PM
Posted in group: JSON Schema
I think the "default" option makes sense.If let's I choose this option then the schema will looks like below. You would save me then in the future alot of time in writing those defaults manually and then debugging.
-Sergey
{
        "type":"object",
        "$schema": "http://json-schema.org/draft-03/schema",
        "properties":{
                "address": {
                        "type":"object",
                        "properties":{
                                "city": {
                                        "type":"string",
                               "default":"New York"
                                },
                                "streetAddress": {
                                        "type":"string",
                              "default":"21 2nd Street"    
                                }
                        }
                },
                "age": {
                        "type":"number",
                  "default":25
                },
                "firstName": {
                        "type":"string",
                  "default":"John"
                },
                "lastName": {
                        "type":"string",
                  "default":"Smith"
                },
                "phoneNumber": {
                        "type":"array",
                        "items":
                                {
                                        "type":"object",
                                        "properties":{
                                                "number": {
                                                        "type":"string",
                                          "default":"212 555-1234"
                                                },
                                                "type": {
                                                        "type":"string",
                                           "default":"home"
                                                }
                                        }
                                }
                        

                }
        }
}
-----Original Message-----
From: json-...@googlegroups.com [mailto:json-...@googlegroups.com] On Behalf Of Json Schema
Sent: Thursday, April 19, 2012 3:15 PM
To: json-...@googlegroups.com
Subject: Re: [json-schema] Re: JSON Schema Generator - alpha version available

Leyart   - Thanks for taking a look. I really hope the tool can become
more and more useful for you.

Sergey - Do you mean you would like a setting that you can 'switch
on', so that defaults are provided for schema attributes when they are
not present in the JSON? For example, "required":false. If so, it is a
good idea, but lots of values have no sensible default, such as
description, name, title, minimum, maximum etc.  Do you imagine these
would just have an empty string as a default and included in the
output?  It sounds like you have a good idea, I'm just no entirely
sure what it is yet.


On 19 April 2012 15:53, Leyart <ley...@gmail.com> wrote:
>
> Awesome tool, thank you Jack, I will definitely follow this project.
>
> On 17 Apr, 22:08, Json Schema <jsonsch...@gmail.com> wrote:
> > Hello,
> >
> > An alpha version of the JSON schema generator
> > <http://www.jsonschema.net>is available to use.  Over the coming weeks
> > or months I aim to iron out any:
> >
> >    - Schema syntax errors
> >    - User interface defects
> >    - JavaScript exceptions
> >
> > I also aim to implement:
> >
> >    - Any small UI tweaks / recommendations from those using the tool
> >    - The FAQs page
> >    - A contact form
> >
> > Implementation of the JSON schema draft version
> > 3<http://tools.ietf.org/html/draft-zyp-json-schema-03> is
> > frozen while I ensure the current version is a as solid, reliable, stable
> > and usable as possible. I really don't want to race ahead if the basic
> > version isn't as good as it could be. Some of the changes since I last
> > posted are:
> >
> >    - New UI for adding and properties and items to an object
> >    - The ability to collapse / expand each schema
> >    - Modifying a schema is much faster since only changes are rendered
> >    - A textarea view to easily Select All and Copy the resulting schema
> >    - Ability to edit the 'key' value of a key/value pair
> >    - General UI tidying
> >    - Drastically improved performance when handling large schemas
> >    - A String view, just because I thought it may be useful
> >
> > Once I *(and any users!*) are happy with the stability of the tool, then I
> > will expand the implementation of the JSON schema draft.  With this in
> > mind, I would like to ask which areas of the schema people feel should be
> > implemented first.
> >
> > Lastly, I realise development of the tool has taken place on the live site.
> > This is far from ideal and *will no longer be the case. *Aside from
> > improvements and bug fixes,www.jsonschema.netwill always host a working
> > version.
> >
> > Kind regards,
> > Jack
>
> --
> You received this message because you are subscribed to the Google Groups "JSON Schema" group.
> To post to this group, send email to json-...@googlegroups.com.
> To unsubscribe from this group, send email to json-schema...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/json-schema?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "JSON Schema" group.
To post to this group, send email to json-...@googlegroups.com.
To unsubscribe from this group, send email to json-schema...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/json-schema?hl=en.


_____________________________________________________
This electronic message and any files transmitted with it contains
information from iDirect, which may be privileged, proprietary
and/or confidential. It is intended solely for the use of the individual
or entity to whom they are addressed. If you are not the original
recipient or the person responsible for delivering the email to the
intended recipient, be advised that you have received this email
in error, and that any use, dissemination, forwarding, printing, or
copying of this email is strictly prohibited. If you received this email
in error, please delete it and immediately notify the sender.
_____________________________________________________