<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

<!ENTITY RFC1035 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3339 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3339.xml">
<!ENTITY RFC3986 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">

]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc category="std" docName="draft-hallambaker-scijer-00" ipr="trust200902">
    
    <front>
        <title abbrev="SCIJER JSON BINDING">Simple Cloud Interoperable Jason Encoding for REST Web Services (SCIJER) Bindings</title>
        <author fullname="Phillip Hallam-Baker" initials="P. M." surname="Hallam-Baker">
            <organization>Comodo Group Inc.</organization>
            <address>
                <email>philliph@comodo.com</email>
            </address>
        </author>
        
        
        <date day="31" month="July" year="2012" />
        
        <area>General</area>
        
        <workgroup>Internet Engineering Task Force</workgroup>
        
        <keyword>JSON</keyword>
        
        
        <abstract>
            <t>
                SCIJER (pronounced skyjer) specifies a mapping of  data types to 
                JavaScript Object Notation (JSON) encoding. The JSON specification 
                defines encodings for integers, strings, arrays and objects. This
                document specifies a mapping between JSON encoding and an extended
                set of types.
            </t>
        </abstract>
    </front>
    
    <middle>
        <section title="Definitions">
            <section title="Requirements Language">
                <t>
                    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
                    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
                    document are to be interpreted as described in <xref target="RFC2119"/>.
                </t>
            </section>
            <section title="Defined Terms">
                <t>The following terms are used in this document:</t>
                <t>
                    <list style="hanging">
                        <t>
                        </t>
                    </list>
                </t>
            </section>
        </section>
        <section title="Introduction">
            <t>
                JSON is a format for encoding data structures in UTF8 text
                format with similar capabilities to XML and ASN.1 but with lower coding
                overhead. Unlike XML and ASN.1, JSON does not have a schema language.
            </t>
            <t>
                This draft defines a mapping between JSON data types and programming language
                types that MAY be used as the basis for a schema language definition. 
            </t>
            
            
        </section>
        <section title="Bindings">
            <t>
                Specify conversions between JSON encoding and C, C# and Java types.
            </t>

            <t>
                
            </t>
            <section title="Object">
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                        </t>
                        <t hangText="C">
                        </t>
                        <t hangText="C#">
                        </t>
                        <t hangText="Java">
                        </t>                    
                    </list>
                </t>
            </section>
            <section title="Serializable">
                <section title="Array">
                    <t>
                        <list style="hanging">
                            <t hangText="JSON">
                            </t>
                            <t hangText="C">
                            </t>
                            <t hangText="C#">
                            </t>
                            <t hangText="Java">
                            </t>                    
                        </list>
                    </t>
                </section>
                <section title="List">
                    <t>
                        <list style="hanging">
                            <t hangText="JSON">
                            </t>
                            <t hangText="C">
                            </t>
                            <t hangText="C#">
                            </t>
                            <t hangText="Java">
                            </t>                    
                        </list>
                    </t>
                </section>
            </section>
            <section title="Boolean">
                    <t>
                        <list style="hanging">
                            <t hangText="JSON">
                                true | false
                            </t>
                            <t hangText="C">
                                int
                            </t>
                            <t hangText="C#">
                                bool
                            </t>    
                            <t hangText="C#">
                                boolean
                            </t> 
                        </list>
                    </t>                    

            </section>
            <section title="Integer">
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                            number without decimal point
                        </t>
                        <t hangText="C, C#, Java">
                            int or long
                        </t>
                   
                    </list>
                </t>
            </section>
            <section title="Floating Point">
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                            number with decimal point
                        </t>
                        <t hangText="C, C#, Java">
                            float or double
                        </t>
                    </list>
                </t>
            </section>           
            <section title="String">
                <t>
                    The String type maps to the JSON string encoding. The following subtypes are defined
                    to represent commonly used syntactic restrictions.
                </t>
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                            String encoding
                        </t>
                        <t hangText="C">
                            char * [NB must use appropriate wrappers to encode/decode UTF8]
                        </t>
                        <t hangText="C#, Java">
                            String
                        </t>
                    </list>
                </t>
                <t>
                    <list>
                        <t>URI
                        </t>
                        <t>Label</t>
                        <t>Name</t>
                    </list>
                </t>
            <section title="URI">
                <t>
                    A URI is a string that contains a URI as specified in <xref target="RFC3986"/>.
                </t>
            </section>
            <section title="Label">
                <t>
                    A label is a string that MUST NOT contain any ASCII character other
                    than digits (0-9), alphabetic (a-z, A-Z), underscore or dash. All other 
                    UNICODE characters are permitted.
                </t>
                <t>
                    The Label type provide a means of avoiding content injection attacks by ensuring
                    that a field does not contain characters commonly used as control 
                    characters in scripting languages.
                </t>
            </section>  
                <section title="Name">
                    <t>
                        A Name is a sequence of Labels separated by period characters '.'.
                    </t>
                    <t>
                        Note that the syntactic restriction of a Name is not exactly the same
                        as the restriction on a DNS address.
                    </t>
                </section> 
            </section>
            <section title="Enumeration">
                <t>
                    An enumeration is encoded as a Label.
                </t>
            </section>
            <section title="Time">
                <t>
                    SSCIJER supports two encodings 
                    <list style="hanging">
                        <t hangText="DateTime">
                            A string encoded in <xref target="RFC3339"/> format. This provides a 
                            human readable representation.
                        </t>
                        <t hangText="ElapsedTime">
                            A number that represents the number of seconds  
                            that have elapsed since January 1, 0001 at 00:00:00.000
                            in the Gregorian calendar. Decimals MAY be used to represent 
                            time intervals of less than a second.
                        </t>
                    </list>
                </t>
                <t>
                    Conversion between the two encodings MUST be informed by the times at which 
                    leap seconds were introduced into the UTC coding. This creates a challenge
                    in the case that a device only has access to time in one form but not the
                    other.
                </t>
                <t>
                    In order to address this problem, implementations MUST accept time values 
                    encoded in either format and SHOULD emit the encoding specified in the 
                    schema.
                </t>
            <section title="DateTime">
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                            String [Encoded in <xref target="RFC3339"/> format.]
                        </t>
                        <t hangText="C">
                            System dependent
                        </t>
                        <t hangText="C#">
                            DateTime
                        </t>
                        <t hangText="Java">
                            Date
                        </t>
                    </list>
                </t>
                <t>
                    Represents a date and time in the Gregorian callendar using the format
                    described in <xref target="RFC3339"/>.
                </t>
            </section>
            <section title="ElapsedTime">
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                            Number 
                        </t>
                        <t hangText="C">
                            System dependent
                        </t>
                        <t hangText="C#">
                            DateTime
                        </t>
                        <t hangText="Java">
                            Date
                        </t>
                    </list>
                </t>
                <t>
                    A number that represents the number of seconds  
                    that have elapsed since January 1, 0001 at 00:00:00.000
                    in the Gregorian calendar. Decimals MAY be used to represent 
                    time intervals of less than a second.
                </t>
            </section> 
            </section>
            <section title="Binary">
                <t>
                    <list style="hanging">
                        <t hangText="JSON">
                            String [Base64 encoding of binary data]
                        </t>
                        <t hangText="C">
                            {unsigned char *, length}
                        </t>
                        <t hangText="C#, Java">
                            byte []
                        </t>
                    </list>
                </t>
            </section>
            <section title="">
            </section>
        </section>
        <section title="Security Considerations">

        </section>
        
        <section title="IANA Considerations">


        </section>
        <section title="Acknowledgements">
            <t>
                The name of this draft was inspired by Mark Nottingham.
            </t>
        </section>        
    </middle>
    
    
    
    <back>
        <references title="Normative References">
            &RFC1035;
            &RFC2119;
            &RFC3339;
            &RFC3986;
        </references>
   <!--     <references title="Informative  References">
            &RFC3647;
        </references> -->
        
    </back>
</rfc>
