Skip to content

Instantly share code, notes, and snippets.

@roy-mor
Last active Apr 29, 2020
Embed
What would you like to do?
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