Skip to content

Instantly share code, notes, and snippets.

@vespertilian
Last active February 14, 2017 06:46
Show Gist options
  • Save vespertilian/c63d6f06c14bed5af90b to your computer and use it in GitHub Desktop.
Save vespertilian/c63d6f06c14bed5af90b to your computer and use it in GitHub Desktop.
Filter samples for Swagger and Strongloop Loopback
{"where": {"teamId": 1}}
use in swagger will url encode
{"include": ["price","item"]}
or
localhost:3000/api/stores/66525d9f-ca9a-4e6e-aaac-79f41746543f/storeitems?filter[include]=price&filter[include]=item
const filter = {
filter: {
include: [
'price',
{
relation: 'item',
scope: {
include: ['layer', 'category', 'subCategory', 'option'],
}
},
],
fields: {priceId: true, id: true, itemId: true}
}
};
filter: {
include: [
'price',
{
'item': ['layer', 'category', 'subCategory', 'option']
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment