[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [csaf] First question that comes up when creating a JSON schema - what's the naming convention for fields?
Eric – here’s a copy from STIX2.x specification documents that were used and I believe are based on common OASIS practices.
1.6 Naming Requirements
1.6.1 Property Names and String Literals In the JSON serialization all property names and string literals
MUST be exactly the same, including case, as the names listed in the property tables in this specification. For example, the SDO common property
created_by_ref must result in the JSON key name "created_by_ref". Properties marked required in the
property tables MUST be present in the JSON serialization.
1.7 Document Conventions
1.7.1 Naming Conventions All type names, property names and literals are in lowercase, except when referencing canonical names defined in another standard (e.g. literal values from an IANA
registry). Words in property names are separated with an underscore (_), while words in type names and string enumerations are separated with a hyphen (-). All type names, property names, object names, and vocabulary terms are between three and 250 characters
long.
1.7.2 Font Colors and Style The following color, font and font style conventions are used in this document:
Allan Thomson CTO (+1-408-331-6646) From: <csaf@lists.oasis-open.org> on behalf of Eric Johnson <eric@tibco.com> "snake_case" "camelCase" "CamelCase" Hyphens definitely a bad idea. _javascript_ convention suggests "camelCase" is the right choice. JSON schema itself follows "camelCase". Does anyone know if OASIS has established a best practice here, or if other TCs have set an OASIS precedent that we should follow? (OData appears to use "camelCase"). Absent feedback from anyone, I'm going to assume "camelCase". Eric. P.S. Style guides from around the web:
Google,
Apiary,
JSON-API . I found lots of other examples of people
using camelCase, but no explicit style guides that mention JSON patterns. |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]