The RCS JSON SchemaΒΆ

RCS uses a JSON schema to validate registration requests (see RCS Service Contract). The schema is written against draft 04 of JSON Schema and is reproduced below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "RCS Schema",
    "description": "An RCS request object",

    "defs": {

        "metadata": {
            "type": "object",
            "oneOf": [
                { "properties": { "uuid": { "type": "string" } }, "additionalProperties": false },
                { "properties": { "metadata_url": { "type": "string" }, "catalogue_url": { "type": "string" } }, "additionalProperties": false }
            ]
        },

        "featureNode": {
            "type": "object",
            "properties": {
                "service_url": { "type": "string" },
                "service_name": { "type": "string" },
                "display_field": { "type": "string" },
                "metadata": { "$ref": "#/defs/metadata" }
            },
            "required": [ "service_url" ],
            "additionalProperties": false
        },

        "wmsNode": {
            "type": "object",
            "properties": {
                "service_url": { "type": "string" },
                "layer": { "type": "string" },
                "legend_format": { "type": "string" },
                "feature_info_type": { "type": "string" },
                "metadata": { "$ref": "#/defs/metadata" }
            },
            "required": [ "service_url", "layer" ],
            "additionalProperties": false
        },

        "f": {
            "type": "object",
            "properties": {
                "payload_type": { "type": "string", "enum": [ "feature" ] },
                "en": {"$ref": "#/defs/featureNode"},
                "fr": {"$ref": "#/defs/featureNode"}
            }
        },

        "w": {
            "type": "object",
            "properties": {
                "payload_type": { "type": "string", "enum": [ "wms" ] },
                "en": {"$ref": "#/defs/wmsNode"},
                "fr": {"$ref": "#/defs/wmsNode"}
            }
        }

    },

    "properties": {
        "version": { "type": "string", "enum": [ "1.0.0", "1.1" ] },
        "payload_type": { "type": "string", "enum": ["feature","wms"] }
    },

    "oneOf": [ { "$ref": "#/defs/f" }, { "$ref": "#/defs/w" } ]
}

A sample request:

{
    "version": "1.1",
    "payload_type": "wms",
    "en": {
        "service_url": "http://wms.ess-ws.nrcan.gc.ca/wms/toporama_en",
        "layer": "limits",
        "metadata": { "uuid": "7" }
    },
    "fr": {
        "service_url": "http://wms.ess-ws.nrcan.gc.ca/wms/toporama_fr",
        "layer": "limits",
        "metadata": { "uuid": "7" }
    }
}

Previous topic

RCS Service Contract

Next topic

RCS Service Contract

This Page