lightblue-platform / lightblue-applications

GNU General Public License v3.0
5 stars 9 forks source link

Data app: Provide query templates #112

Open paterczm opened 9 years ago

paterczm commented 9 years ago

The app already provides some base query body, e.g.:

{
  "objectType": "terms",
  "version": "2.1.0",
}

It's of little help. I would like it to provide a simple, but working query:

{
  "objectType": "terms",
  "version": "2.1.0",
  "query":{  
      "field":"objectType",  
      "op":"=",  
      "rvalue":"terms"  
  },  
  "projection":[  
      {  
        "field":"*",
        "include": true
      }  
  ] 
}

Which can be used as a base to query for whatever you need.

This is a find example. We need example queries for save, update and delete too.

bvulaj commented 9 years ago

Just throwing this out there, but has anybody investigated Swagger for this kind of thing? Not necessarily just this, but potentially the data and metadata management applications as well.

Here's a very basic example containing a swagger-generated PUT body. The swagger schema itself is, in this case, generated from a Jersey / JAXRS application.

paterczm commented 9 years ago

We didn't investigate Swagger (first time I hear about it), but it does look interesting. Could you create an issue tagged as enhancement in the lightblue-rest project?