json-schema-filter icon indicating copy to clipboard operation
json-schema-filter copied to clipboard

GeoJSON not supported

Open nitrag opened this issue 9 years ago • 2 comments
trafficstars

I think there is a clash because the GeoJSON object has a object called properties.

nitrag avatar Aug 27 '16 05:08 nitrag

Here's my schema, all objects under a geojson.features[0].properties are being included instead of only name/id like I want. So the schema is ignored. Working for geometry though...

var schema = {
    "title": "Simple GeoJSON Schema",
    "type": "object",
    "properties": {
      "type": {
        "type": "string"
      },
      "features":{
        "type": "array",
        "required": true,
        "items": { 
          "type": "object",
          "required": true,
          "properties": {
            "type": {
              "type": "string"
            },
            "geometry": {
              "type": "object",
              "required": true,
              "items": {
                "type": "object",
                "required": true,
                "properties": {
                  "type": {
                    "type": "string",
                    "required": true
                  },
                  "coordinates": {
                    "type": "array",
                    "required": true
                  }
                }
              }
            },
            "properties": {
              "type": "object",
              "required": true,
              "items": {
                "type":"object",
                "required":true,
                "properties": {
                  "name": {
                    "type": "string",
                    "required": true
                  },
                  "id": {
                    "type": "string",
                    "required": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "required": ["geometry", "properties"]
};

nitrag avatar Aug 27 '16 05:08 nitrag

Hey, I think if I understand correctly, geoJSON definition conflicts with the JSONSchema standard? Are we talking about a specific exception or standards issue here? I will read up more on this, but wondering if is more a conflict with geoJSON and JSONScema issue?

alank64 avatar Dec 20 '16 15:12 alank64