You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Feature object has a member with the name "properties". The value of the properties member is an object (any JSON object or a JSON null value).
I found that you could remove a Feature "properties" property and still have the format validated.
Such property can be null or any object, possibly empty, but should always be there.
Delete line 609 to 611 in test/GeoJSON.integration.js: all tests are still successful.
The text was updated successfully, but these errors were encountered:
OlivierMartineau
changed the title
Feature.property should be mandatory
Feature.properties should be mandatory
Jul 16, 2021
I suggest to change index.js line 496 to the following:
Feature.schemaName='Feature'functionvalidateFeature(feature){if(!feature.type){thrownewmongoose.Error('Feature must have a type')}// type must be Featureif(feature.type!=='Feature'){thrownewmongoose.Error(feature.type+' is not a valid GeoJSON type')}if(!feature.geometry){thrownewmongoose.Error('Feature must have a geometry')}// check for crsif(feature.crs){crs=feature.crsvalidateCrs(crs)}validateGeometry(feature.geometry)validateFeatureProperties(feature.properties)}functionvalidateFeatureProperties(properties){if(properties===null)returnif(!properties){thrownewmongoose.Error('Feature must have a "properties" member')}if(typeofproperties!=='object'){thrownewmongoose.Error('Feature properties must be a JSON object or a null value.')}}
https://datatracker.ietf.org/doc/html/rfc7946#section-3.2
A Feature object has a member with the name "properties". The value of the properties member is an object (any JSON object or a JSON null value).
I found that you could remove a Feature "properties" property and still have the format validated.
Such property can be null or any object, possibly empty, but should always be there.
Delete line 609 to 611 in test/GeoJSON.integration.js: all tests are still successful.
The text was updated successfully, but these errors were encountered: