Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
cc04cd95
Commit
cc04cd95
authored
10 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
test fix
parent
23f907f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.dir-locals.el
+1
-0
1 addition, 0 deletions
.dir-locals.el
src/metabase/api/common.clj
+2
-1
2 additions, 1 deletion
src/metabase/api/common.clj
test/metabase/api/common_test.clj
+11
-13
11 additions, 13 deletions
test/metabase/api/common_test.clj
with
14 additions
and
14 deletions
.dir-locals.el
+
1
−
0
View file @
cc04cd95
...
...
@@ -17,6 +17,7 @@
(
execute-query
1
)
(
expect
1
)
(
expect-eval-actual-first
1
)
(
expect-expansion
0
)
(
expect-let
1
)
(
ins
1
)
(
let-400
1
)
...
...
This diff is collapsed.
Click to expand it.
src/metabase/api/common.clj
+
2
−
1
View file @
cc04cd95
...
...
@@ -377,7 +377,8 @@
- executes BODY inside a `try-catch` block that handles `ApiExceptions`
- automatically calls `wrap-response-if-needed` on the result of BODY
- tags function's metadata in a way that subsequent calls to `define-routes` (see below)
will automatically include the function in the generated `defroutes` form."
will automatically include the function in the generated `defroutes` form.
- Generates a super-sophisticated Markdown-formatted docstring"
{
:arglists
'
([
method
route
docstr?
args
annotations-map?
&
body
])}
[
method
route
&
more
]
{
:pre
[(
or
(
string?
route
)
...
...
This diff is collapsed.
Click to expand it.
test/metabase/api/common_test.clj
+
11
−
13
View file @
cc04cd95
...
...
@@ -142,16 +142,14 @@
;; replace regex `#"[0-9]+"` with str `"#[0-9]+" so expectations doesn't barf
(
binding
[
*auto-parse-types*
(
update-in
*auto-parse-types*
[
:int
:route-param-regex
]
(
partial
str
"#"
))]
(
expect-expansion
(
do
(
def
GET_
:id
(
GET
[
"/:id"
:id
"#[0-9]+"
]
[
id
]
(
metabase.api.common.internal/catch-api-exceptions
(
metabase.api.common.internal/auto-parse
[
id
]
(
metabase.api.common.internal/let-annotated-args
{
id
Required
}
(
clojure.core/->
(
do
(
->404
(
sel
:one
Card
:id
id
)))
metabase.api.common.internal/wrap-response-if-needed
))))))
(
clojure.core/alter-meta!
#
'GET_
:id
clojure.core/assoc
:is-endpoint?
true
))
(
defendpoint
GET
"/:id"
[
id
]
{
id
Required
}
(
->404
(
sel
:one
Card
:id
id
)))))
(
def
GET_
:id
(
GET
[
"/:id"
:id
"#[0-9]+"
]
[
id
]
(
metabase.api.common.internal/catch-api-exceptions
(
metabase.api.common.internal/auto-parse
[
id
]
(
metabase.api.common.internal/let-annotated-args
{
id
Required
}
(
clojure.core/->
(
do
(
->404
(
sel
:one
Card
:id
id
)))
metabase.api.common.internal/wrap-response-if-needed
))))))
(
defendpoint
GET
"/:id"
[
id
]
{
id
Required
}
(
->404
(
sel
:one
Card
:id
id
)))))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment