DataSpace-Mobility / data-standard-registry-doc

https://standards.dataspace.mobi
1 stars 2 forks source link

check if an object is defined within a json object #24

Open upperwal opened 3 years ago

upperwal commented 3 years ago

For the given code:

https://github.com/DataSpace-Mobility/data-standard-registry-doc/blob/5a794049fed8726719396d99236a5d5fe8c1fdf6/api/controllers/standard/standard.controller.js#L5

https://github.com/DataSpace-Mobility/data-standard-registry-doc/blob/5a794049fed8726719396d99236a5d5fe8c1fdf6/api/controllers/standard/standard.controller.js#L49

We need to validate if these variables are passed within the body object. Try passing an incorrect json request and the code would fail without informing the user.

Try:

{
"data": [{
  "info": {
    "category": {
      "name": "Electric Mobility"
    },
    "authors": [
      "ISCF"
    ],
    "name": "GTFS"
}]
}
groverHarshit commented 3 years ago

Working on it.!

groverHarshit commented 3 years ago

Resolved under commit 9369ade108f85fc662f16bb6e888403932e8c7e5

groverHarshit commented 3 years ago

Check Commit 629d13179736fdb129523580f0a5563fe6d2493e