Skip to content

Instantly share code, notes, and snippets.

@roy-mor
Last active April 29, 2020 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roy-mor/abbfb3bfd03bd9b1572e785a4ecd37d7 to your computer and use it in GitHub Desktop.
Save roy-mor/abbfb3bfd03bd9b1572e785a4ecd37d7 to your computer and use it in GitHub Desktop.
manifest.json example for GraphQL2REST (advanced mode)
{
"endpoints": {
"/users/:id": {
"get": {
"description": "Get user by ID",
"operation": "getUserObjByOid",
"params": {
"userOid": "id"
}
},
"delete": {
"description": "Delete user by ID",
"operation": "removeUser",
"params": {
"userOid": "id"
},
"successStatusCode": 204
}
},
"/datasets": {
"get": {
"description": "Get list of all datasets in the system",
"operation": "listAllDatasets"
},
"post": {
"operations": [{
"description": "Create new dataset instance V1",
"operation": "addDatasetV1ToCollection",
"condition": {
"type": {
"$in": ["old", "v1"]
},
"params": {
"datasetToAdd": "data"
},
"successStatusCode": 201,
"hide": ["v1_internalRepresentation", "ownerId"]
}
},
{
"description": "Create new dataset instance V2",
"operation": "addDatasetV2ToCollection",
"condition": {
"type": {
"$in": ["new", "v2"]
},
"params": {
"newDatasetFormat": "data"
},
"successStatusCode": 201
}
}
]
}
}
},
"errors": {
"errorCodes": {
"1000": {
"httpCode": 500
},
"4003": {
"httpCode": 403,
"errorDescription": "Forbidden: Unauthorized access"
},
"1017": {
"httpCode": 503,
"errorDescription": "Service Unavailable: Cannot retrieve logs, please try again later"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment