Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
/ api-schema Public archive

A DSL definition of StepWeb API using JSON Schema.

Notifications You must be signed in to change notification settings

Trufa-me/api-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

api-schema

A DSL definition of StepWeb API using JSON Schema.

Person

Properties

  • start (integer) - Starting index to offset results from.
  • count (integer) - Maximum number of results to return.
  • expand (boolean) - false (default) returns summary profiles, true returns complete profiles.
  • query (object) - Definition of the query. See below for examples.

Query Examples

Basic Leaf Query

{
  "start": 0,
  "count": 10,
  "query": {
    "entity": "experience",
    "criteria": {
      "company": "My Corporation",
      "start": {
        "from": "2014-03-15T16:44:53+01:00"
      },
      "end": {
        "to": "2016-04-08T16:44:53+01:00"
      }
    }
  }
}

Basic 'Has Field' Query

{
  "start": 0,
  "count": 10,
  "query": {
    "entity": "email",
    "criteria": {
      "exists": true
    }
  }
}

Basic AND Query

{
  "start": 0,
  "count": 10,
  "query": {
    "AND": [
      {
        "entity": "experience",
        "criteria": {
          "company": "My Corporation",
          "start": {
            "from": "2014-03-15T16:44:53+01:00"
          },
          "end": {
            "to": "2016-04-08T16:44:53+01:00"
          }
        }
      },
      {
        "entity": "education",
        "criteria": {
          "establishment": "Oxford University"
        }
      }
   ]
  }
}

Basic OR Query

{
  "start": 0,
  "count": 10,
  "query": {
    "OR": [
      {
        "entity": "experience",
        "criteria": {
          "company": "My Corporation"
        }
      },
      {
        "entity": "experience",
        "criteria": {
          "company": "ACME"
        }
      }
    ]
  }
}

Nested Query

{
  "start": 0,
  "count": 10,
  "query": {
    "OR": [
      {
        "entity": "experience",
        "criteria": {
          "company": "My Corporation",
          "start": {
            "from": "2014-03-15T16:44:53+01:00"
          },
          "end": {
            "to": "2016-04-08T16:44:53+01:00"
          }
        }
      },
      {
        "AND": [
          {
            "entity": "experience",
            "criteria": {
              "company": "ACME"
            }
          },
          {
            "entity": "education",
            "criteria": {
              "establishment": "Oxford University"
            }
          }
        ]
      }
    ]
  }
}

Date Range Query

{
  "start": 0,
  "count": 10,
  "query": {
    "entity": "experience",
    "criteria": {
      "company": "My Corporation",
      "start": {
        "from": "2014-03-15T16:44:53+01:00",
        "to": "2014-09-15T16:44:53+01:00"
      },
      "end": {
        "from": "2016-01-08T16:44:53+01:00",
        "to": "2016-04-08T16:44:53+01:00"
      }
    }
  }
}

About

A DSL definition of StepWeb API using JSON Schema.

Resources

Stars

Watchers

Forks

Packages

No packages published