gaia icon indicating copy to clipboard operation
gaia copied to clipboard

Refactor request parsing

Open mbertrand opened this issue 9 years ago • 3 comments

@aashish24 This is in regards to your suggestion yesterday to refactor how/where request parsing takes place, could you provide some more details? I think you mentioned having request JSON parsed by the process object itself? But the request parser in it's current state is responsible for actually creating the process.

Here is an example of the current request parser being used in Girder: screen shot 2016-02-24 at 9 46 53 am

mbertrand avatar Feb 24 '16 14:02 mbertrand

@kotfic I replaced the GaiaRequestParser with a slightly modified version of your custom_json_deserialize JSON function in the postgis branch, and modified the request JSON accordingly. Example:

{
  "_type": "gaia.geo.processes_vector.WithinProcess",
  "inputs": [
      {
          "_type": "gaia.inputs.VectorFileIO",
          "name": "first",
          "uri": "{basepath}/iraq_hospitals.geojson"
      },
      {
          "_type": "gaia.inputs.ProcessIO",
          "process": {
              "_type": "gaia.geo.processes_vector.BufferProcess",
              "buffer_size": 1000,
              "name": "buffer",
              "inputs": [
                  {
                      "_type": "gaia.inputs.VectorFileIO",
                      "uri": "{basepath}/iraq_roads.geojson",
                      "filters": [
                          ["type","=","motorway"]
                      ]
                  }
              ]
          }
      }
  ]
}

mbertrand avatar Mar 04 '16 22:03 mbertrand

https://github.com/OpenDataAnalytics/gaia/pull/58

mbertrand avatar Mar 07 '16 21:03 mbertrand

@mbertrand sorry for the turn around time on review. Looked at deserialize function in the postgis branch and it looks good to me. Once that's in i think we can close this.

kotfic avatar Mar 16 '16 12:03 kotfic