Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HAfAH
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
HAfAH
Merge requests
!148
Catch null results in json-rpc apis
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Catch null results in json-rpc apis
mzander/workaround-for-null
into
develop
Overview
0
Commits
1
Pipelines
2
Changes
1
Closed
Michal Zander
requested to merge
mzander/workaround-for-null
into
develop
6 months ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
develop
version 1
f4515e62
6 months ago
develop (base)
and
latest version
latest version
2855e353
1 commit,
4 months ago
version 1
f4515e62
1 commit,
6 months ago
1 file
+
7
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
postgrest/hafah_endpoints.sql
+
7
−
2
Options
@@ -42,7 +42,7 @@ DECLARE
__params
JSON
;
__id
JSON
;
__result
JSON
;
__result
JSON
B
;
__api_type
TEXT
;
__method_type
TEXT
;
__is_legacy_style
BOOLEAN
;
@@ -53,7 +53,7 @@ BEGIN
__params
=
(
__request_data
->
'params'
);
__id
=
(
__request_data
->
'id'
);
SELECT
NULL
::
JSON
INTO
__result
;
SELECT
NULL
::
JSON
B
INTO
__result
;
IF
__jsonrpc
!=
'2.0'
OR
__jsonrpc
IS
NULL
OR
__params
IS
NULL
OR
__id
IS
NULL
THEN
RETURN
hafah_backend
.
raise_exception
(
-
32600
,
'Invalid JSON-RPC'
);
@@ -90,6 +90,11 @@ BEGIN
END
IF
;
END
IF
;
IF
__result
=
'null'
THEN
RAISE
NOTICE
'null in % api'
,
__method
;
__result
:
=
'[]'
::
JSONB
;
END
IF
;
IF
__result
IS
NULL
THEN
RETURN
hafah_backend
.
raise_exception
(
-
32601
,
'Method not found'
,
__method
,
__id
);
ELSEIF
__result
->
'error'
IS
NULL
THEN
Loading