blazer_json_api 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -9
- data/app/controllers/blazer_json_api/application_controller.rb +1 -1
- data/app/controllers/blazer_json_api/queries_controller.rb +2 -2
- data/app/helpers/blazer_json_api/application_helper.rb +1 -1
- data/app/jobs/blazer_json_api/application_job.rb +1 -1
- data/app/mailers/blazer_json_api/application_mailer.rb +1 -1
- data/app/models/blazer_json_api/application_record.rb +1 -1
- data/lib/blazer_json_api/process_statement_variables.rb +0 -2
- data/lib/blazer_json_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd329ef99930168a04d81e45b6c66b8dba865f624ae90c115d54822ba8638db8
|
4
|
+
data.tar.gz: 0e16b3de5dc5f23ed9ea4b266a20d0341dccebb7a2c5cfe7f059f3058ede8926
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6d2f729fca9746581cc5184f02ad64fe96e028930fb3e7f4f9c49dc74870865c27c1d18f8f5d8be745404d2e227b917bb46abf6d1311537449bbb3fda9cd63e
|
7
|
+
data.tar.gz: 14b0d4e8138fcdd12c9710f1db35570eb026c8c0bd2a722c666f0183b04673183439679efea599614079f716ecd1f4bd1e4c6e10c0458550a92c567cf390a0b5
|
data/README.md
CHANGED
@@ -98,16 +98,20 @@ e.g. `/blazer-api/queries/1-all-users?username=blazer_john`
|
|
98
98
|
|
99
99
|
It would result in the following response.
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
}
|
101
|
+
#### Using a variable/url parameter conditionally (e.g. optional filter)
|
102
|
+
|
103
|
+
It's possible to make a filter optional directly in SQL as follows
|
104
|
+
|
105
|
+
```sql
|
106
|
+
SELECT id, username, first_name, last_name, email, country
|
107
|
+
FROM users
|
108
|
+
WHERE {username} IS NULL OR username={username}
|
110
109
|
```
|
110
|
+
|
111
|
+
In this scenario, the url parameter/filter for `username` is optional.
|
112
|
+
|
113
|
+
If provided it will apply the filter, if not provided, it will return an unfiltered response.
|
114
|
+
|
111
115
|
#### Controlling response structure
|
112
116
|
Standard queries return flat JSON responses that correspond to the results table from executing the SQL.
|
113
117
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blazer_json_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|