Schema Property Order

Standard JSON Schema does not support specifying an order to the properties defined in a schema.

If the fields in your JSON or DSV data objects must be displayed in a specific order, you can use the custom property x-position to define what that order must be. The value for x-position must be an integer.

Example schema:

{  
   "$schema":"http://json-schema.org/draft-06/schema#",
   "title":"Schema Property Order",
   "description":"Sample schema to include property order",
   "type":"object",
   "properties":{  
   	   "divisionName":{  
            "type":"string",
            "maxLength":16,
	       "x-position":2
         },
         "divisionId":{  
            "type":"string",
            "maxLength":250,
	       "x-position":1
         },
         "updateDateTime":{  
            "type":"string",
            "format":"date-time"
         },
         "variationNumber":{
            "type":"integer"
         },
         "companyId":{  
            "type":"string",
            "x-position":3
         }
         
   }

Since x-position is optional, it is not required to include it for all properties in the schema. It is up to the applications using this metadata to determine how to handle the display of fields that do not include an x-position value.