Creating JSON Schemas

You can create JSON schemas using the following procedure or alternatively you can create a JSON schema by deriving it from a JSON string sample (often made available by the documentation for the REST service). See Creating JSON schema from a JSON sample.

A JSON schema declares the types and properties of the complex types used for request / response payload data when invoking REST service methods.

Procedure

  1. Right-click a REST Services project in Project Explorer and select New > New JSON Schema.
  2. On the Create a new JSON Schema file dialog, click Finish.
  3. Add Properties to the JSON object.
  4. Create and use child types for properties of a complex type.
  5. On the General tab on the Properties view for a JSON Object Type, edit the property types (which are 'Text' by default). Alternatively you can drag-drop types onto properties in the main editor. You can also move properties around using drag drop or the controls provided.
    For services that require or return arrays, check Array.
    Note: You can also create schemas by importing IETF JSON Schema files (as defined at http://json-schema.org/).