Skip to content

Fix copy and paste-ability of filtering examples #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 6 additions & 47 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ info:

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { \
"class": "standard"
}'
-H 'X-Filter: { "class": "standard" }'
```

The filter object's keys are the keys of the object you're filtering,
Expand All @@ -193,11 +191,8 @@ info:
Types that offer one vcpu:

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { \
"class": "standard",
"vcpus": 1
}'
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { "class": "standard", "vcpus": 1 }'
```

In the above example, both filters are combined with an "and" operation.
Expand All @@ -206,12 +201,7 @@ info:

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: {
"+or": [
{ "vcpus": 1 },
{ "class": "standard" }
]
}'
-H 'X-Filter: { "+or": [ { "vcpus": 1 }, { "class": "standard" } ] }'
```

Each filter in the `+or` array is its own filter object, and all conditions
Expand Down Expand Up @@ -239,11 +229,7 @@ info:

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: {
"memory": {
"+gte": 61440
}
}'
-H 'X-Filter: { "memory": { "+gte": 61440 } }'
```

You can combine and nest operators to construct arbitrarily-complex queries.
Expand All @@ -253,34 +239,7 @@ info:

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: {
"+or": [
{
"+or": [
{
"class": "standard"
},
{
"class": "highmem"
}
]
},
{
"+and": [
{
"vcpus": {
"+gte": 12
}
},
{
"vcpus": {
"+lte": 20
}
}
]
}
]
}'
-H 'X-Filter: { "+or": [ { "+or": [ { "class": "standard" }, { "class": "highmem" } ] }, { "+and": [ { "vcpus": { "+gte": 12 } }, { "vcpus": { "+lte": 20 } } ] } ] }'
```

# CLI (Command Line Interface)
Expand Down