The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Add custom Kondo linter to enforce kebab-case in REST API routes (#65100)
Cam Saulae17be3ee144
diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.ednindex 9f6e6db9ca3..4e3703d5185 100644--- a/.clj-kondo/config.edn+++ b/.clj-kondo/config.edn@@ -60,16 +60,17 @@:metabase/check-me-humanize {:level :warning}:metabase/defsetting-must-specify-export {:level :warning}:metabase/defsetting-namespace {:level :warning}+ :metabase/discourage-millis-duration {:level :warning}:metabase/mbql-query-first-arg {:level :warning}:metabase/missing-test-expr-requires-in-cljs {:level :warning}:metabase/modules {:level :warning} ; more config in `.clj-kondo/config/modules/config.edn`:metabase/namespace-name {:level :warning}:metabase/require-shape-checker {:level :warning}:metabase/test-helpers-use-non-thread-safe-functions {:level :warning} ; more config in `.clj-kondo/config/test-helpers/config.edn`+ :metabase/validate-defendpoint-route-uses-kebab-case {:level :warning}:metabase/validate-logging {:level :warning}:metabase/validate-mb-driver-tests {:level :warning}:metabase/validate-mb-once {:level :warning}- :metabase/discourage-millis-duration {:level :warning}:metabase/validate-deftest{:level :warningdiff --git a/.clj-kondo/src/hooks/metabase/api/macros.clj b/.clj-kondo/src/hooks/metabase/api/macros.cljindex be300a7c6aa..d7c76af9199 100644--- a/.clj-kondo/src/hooks/metabase/api/macros.clj+++ b/.clj-kondo/src/hooks/metabase/api/macros.clj@@ -1,8 +1,23 @@(ns hooks.metabase.api.macros(:require[clj-kondo.hooks-api :as api]+ [clojure.string :as str][hooks.common]))+(defn- validate-route! [route]+ (letfn [(validate-route-string! [route-string]+ (when (and (api/string-node? route-string)+ (str/includes? (api/sexpr route-string) "_"))+ (api/reg-finding! (assoc (meta route-string)+ :message "REST API routes and query params should use kebab-case, not snake_case"+ :type :metabase/validate-defendpoint-route-uses-kebab-case))))]+ (cond+ (api/string-node? route)+ (validate-route-string! route)+ ;; otherwise route is a vector like ["/abc/:d/ :d <regex>]+ (api/vector-node? route)+ (validate-route-string! (first (:children route))))))+(defn defendpoint[arg](letfn [(update-defendpoint [node]@@ -28,6 +43,7 @@:else(recur (conj bindings x) schemas (cons y more)))))]+ (validate-route! route)(-> (api/list-node(list(api/token-node 'do)@@ -54,3 +70,24 @@body))))(with-meta (meta node)))))](update arg :node update-defendpoint)))++(comment+ (defn -defendpoint [form]+ (-> {:node (-> form pr-str api/parse-string)}+ defendpoint+ :node+ api/sexpr))++ (defn x []+ (-defendpoint '(api.macros/defendpoint :get "/:id/syncable_schemas"+ "Returns a list of all syncable schemas found for the database `id`."+ [{:keys [id]} :- [:map+ [:id ms/PositiveInt]]]+ (let [db (get-database id)]+ (api/check-403 (or (:is_attached_dwh db)+ (and (mi/can-write? db)+ (mi/can-read? db))))+ (->> db+ (driver/syncable-schemas (:engine db))+ (vec)+ (sort)))))))diff --git a/CLAUDE.md b/CLAUDE.mdindex 2ea1e661ef1..d1297c45615 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -529,17 +529,6 @@ Review pull requests with a focus on:...)```-- REST API route strings (the second arg to `defendpoint`) should use `kebab-case`, e.g. `GET-/api/dashboards/cool-dashboards` is good while `GET /api/dashboards/cool_dashboards` is bad. More examples:-- ```clj- ;;; Bad- (api.macros/defendpoint :post "/check_transform" ...)-- ;;; Good- (api.macros/defendpoint :post "/check-transform" ...)- ```-- Query parameters should also use kebab-case e.g. `GET /api/dashboards?include-archived=true` is good while `GET/api/dashboards?include_archived=true` or `GET /api/dashboards?includeArchived=true` is bad.diff --git a/enterprise/backend/src/metabase_enterprise/advanced_config/api/logs.clj b/enterprise/backend/src/metabase_enterprise/advanced_config/api/logs.cljindex e668d67f52d..cb52c78aafa 100644--- a/enterprise/backend/src/metabase_enterprise/advanced_config/api/logs.clj+++ b/enterprise/backend/src/metabase_enterprise/advanced_config/api/logs.clj@@ -32,6 +32,8 @@(date-part :month month)]})]results))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/query_execution/:yyyy-mm""Fetch rows for the month specified by `:yyyy-mm` from the query_execution logs table.Must be a superuser."diff --git a/enterprise/backend/src/metabase_enterprise/dependencies/api.clj b/enterprise/backend/src/metabase_enterprise/dependencies/api.cljindex c56a2f4bb6d..138ca91fe48 100644--- a/enterprise/backend/src/metabase_enterprise/dependencies/api.clj+++ b/enterprise/backend/src/metabase_enterprise/dependencies/api.clj@@ -52,6 +52,8 @@broken-cards):bad_transforms (into [] broken-transforms)}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/check_card""Check a proposed edit to a card, and return the card IDs for those cards this edit will break."[_route-params@@ -85,6 +87,8 @@[:query {:optional true} ::queries.schema/query]]]][:target {:optional true} [:maybe ms/Map]]])+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/check_transform""Check a proposed edit to a transform, and return the card, transform, etc. IDs for things that will break."[_route-params@@ -104,6 +108,8 @@;; if this isn't a sql query, just claim it works{:success true}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/check_snippet""Check a proposed edit to a native snippet, and return the cards, etc. which will be broken."[_route-paramsdiff --git a/enterprise/backend/src/metabase_enterprise/metabot_v3/tools/api.clj b/enterprise/backend/src/metabase_enterprise/metabot_v3/tools/api.cljindex 7205c7eccb4..5a997b2ce34 100644--- a/enterprise/backend/src/metabase_enterprise/metabot_v3/tools/api.clj+++ b/enterprise/backend/src/metabase_enterprise/metabot_v3/tools/api.clj@@ -1109,6 +1109,8 @@(metabot-v3.context/log (assoc body :api :search) :llm.log/llm->be)(search arguments conversation_id request))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/search_v2" :- [:merge ::search-result ::tool-request]"Enhanced search with term and semantic queries using Reciprocal Rank Fusion. This is identical to /search, butduplicated in order to add a new capability to AI service that indicates that Metabot can search transforms. Thediff --git a/enterprise/backend/src/metabase_enterprise/sandbox/api/table.clj b/enterprise/backend/src/metabase_enterprise/sandbox/api/table.cljindex 1f93e49f065..f5daa1ebf73 100644--- a/enterprise/backend/src/metabase_enterprise/sandbox/api/table.clj+++ b/enterprise/backend/src/metabase_enterprise/sandbox/api/table.clj@@ -86,6 +86,8 @@;; Not sandboxed, so user can fetch full metadatatable)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/query_metadata""This endpoint essentially acts as a wrapper for the OSS version of this route. When a user has sandboxed permissionsthat only gives them access to a subset of columns for a given table, those inaccessable columns should also bediff --git a/enterprise/backend/src/metabase_enterprise/scim/api.clj b/enterprise/backend/src/metabase_enterprise/scim/api.cljindex e7dc43691f5..74217d68332 100644--- a/enterprise/backend/src/metabase_enterprise/scim/api.clj+++ b/enterprise/backend/src/metabase_enterprise/scim/api.clj@@ -37,6 +37,8 @@:updated_by_id user-id})(assoc :unmasked_key (u.secret/expose unhashed-key))))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/api_key""Fetch the SCIM API key if one exists. Does *not* return an unmasked key, since we don't have accessto that after it is created."@@ -44,6 +46,8 @@(api/check-superuser)(api/check-404 (t2/select-one :model/ApiKey :scope :scim)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/api_key""Create a new SCIM API key, or refresh one that already exists. When called for the first time,this is equivalent to enabling SCIM."diff --git a/enterprise/backend/src/metabase_enterprise/sso/api/sso.clj b/enterprise/backend/src/metabase_enterprise/sso/api/sso.cljindex 8275d33fb9a..85ab25f9635 100644--- a/enterprise/backend/src/metabase_enterprise/sso/api/sso.clj+++ b/enterprise/backend/src/metabase_enterprise/sso/api/sso.clj@@ -93,6 +93,9 @@(str (urls/site-url) metabase-slo-redirect-url))))}));; POST /auth/sso/to_session+;;+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/to_session""If a user wants to simply convert a JWT to a session token (which they'll manage)this provides a path for them to do so."@@ -106,6 +109,9 @@{:session_token (jwt/jwt->session jwt request)});; POST /auth/sso/handle_slo+;;+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/handle_slo""Handles client confirmation of saml logout via slo"[_route-params _query-params _body request]diff --git a/src/metabase/actions/api.clj b/src/metabase/actions/api.cljindex 83e47fa2e08..e06bf6e8926 100644--- a/src/metabase/actions/api.clj+++ b/src/metabase/actions/api.clj@@ -121,6 +121,8 @@:num_parameters (count parameters)})action))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/public_link""Generate publicly-accessible links for this Action. Returns UUID to be used in public links. (If thisAction has already been shared, it will return the existing public link rather than creating a new one.) Public@@ -137,6 +139,8 @@{:public_uuid <>:made_public_by_id api/*current-user-id*})))}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :delete "/:id/public_link""Delete the publicly-accessible link to this Dashboard."[{:keys [id]} :- [:mapdiff --git a/src/metabase/activity_feed/api.clj b/src/metabase/activity_feed/api.cljindex 8897e635599..fb8861316e2 100644--- a/src/metabase/activity_feed/api.clj+++ b/src/metabase/activity_feed/api.clj@@ -110,6 +110,8 @@(def ^:private views-limit 8)(def ^:private card-runs-limit 8)+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/recent_views""Get a list of 100 models (cards, models, tables, dashboards, and collections) that the current user has been viewing mostrecently. Return a maximum of 20 model of each, if they've looked at at least 20."@@ -142,6 +144,8 @@(api/read-check (t2/select-one model-type :id model-id))(recent-views/update-users-recent-views! *current-user-id* model-type model-id context)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/most_recently_viewed_dashboard""Get the most recently viewed dashboard for the current user. Returns a 204 if the user has not viewed any dashboardsin the last 24 hours."@@ -238,6 +242,8 @@(assoc :timestamp (:max_ts % ""))recent-views/fill-recent-view-info)))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/popular_items""Get the list of 5 popular things on the instance. Query takes 8 and limits to 5 so that if it finds anythingarchived, deleted, etc it can usually still get 5. "diff --git a/src/metabase/api/util.clj b/src/metabase/api/util.cljindex b8da2905f32..1e4ea086418 100644--- a/src/metabase/api/util.clj+++ b/src/metabase/api/util.clj@@ -7,6 +7,8 @@(set! *warn-on-reflection* true)+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/random_token""Return a cryptographically secure random 32-byte token, encoded as a hexadecimal string.Intended for use when creating a value for `embedding-secret-key`."diff --git a/src/metabase/dashboards/api.clj b/src/metabase/dashboards/api.cljindex c5341097095..fd5e9556444 100644--- a/src/metabase/dashboards/api.clj+++ b/src/metabase/dashboards/api.clj@@ -1051,6 +1051,8 @@{:cards (:dashcards dashboard):tabs (:tabs dashboard)}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/query_metadata""Get all of the required query metadata for the cards on dashboard."[{:keys [id]} :- [:map@@ -1064,6 +1066,8 @@;;; ----------------------------------------------- Sharing is Caring ------------------------------------------------+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:dashboard-id/public_link""Generate publicly-accessible links for this Dashboard. Returns UUID to be used in public links. (If thisDashboard has already been shared, it will return the existing public link rather than creating a new one.) Public@@ -1079,6 +1083,8 @@{:public_uuid <>:made_public_by_id api/*current-user-id*})))})+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :delete "/:dashboard-id/public_link""Delete the publicly-accessible link to this Dashboard."[{:keys [dashboard-id]} :- [:mapdiff --git a/src/metabase/pulse/api/pulse.clj b/src/metabase/pulse/api/pulse.cljindex 50ef96084cb..9655a63fb8f 100644--- a/src/metabase/pulse/api/pulse.clj+++ b/src/metabase/pulse/api/pulse.clj@@ -232,6 +232,8 @@;; return updated Pulse(models.pulse/retrieve-pulse id))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/form_input""Provides relevant configuration information and user choices for creating/updating Pulses."[]@@ -273,6 +275,8 @@:context :pulse:card-id card-id}))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/preview_card/:id""Get HTML rendering of a Card with `id`."[{:keys [id]} :- [:map@@ -288,6 +292,8 @@result{:channel.render/include-title? true, :channel.render/include-buttons? true})]])}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/preview_dashboard/:id""Get HTML rendering of a Dashboard with `id`.@@ -309,6 +315,8 @@[:body [:h2 (format "Backend Artifacts Preview for Dashboard %s" id)](channel.render/render-dashboard-to-html id)]))})+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/preview_card_info/:id""Get JSON object containing HTML rendering of a Card with `id` and other information."[{:keys [id]} :- [:map@@ -331,6 +339,8 @@(def ^:private preview-card-width 400)+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/preview_card_png/:id""Get PNG rendering of a Card with `id`. Optionally specify `width` as a query parameter."[{:keys [id]} :- [:mapdiff --git a/src/metabase/queries/api/card.clj b/src/metabase/queries/api/card.cljindex 6240dc20dba..36333c0ab56 100644--- a/src/metabase/queries/api/card.clj+++ b/src/metabase/queries/api/card.clj@@ -688,6 +688,8 @@body :- CardUpdateSchema](update-card! id body (boolean delete-old-dashcards?)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/query_metadata""Get all of the required query metadata for a card."[{:keys [id]} :- [:map@@ -861,6 +863,8 @@;;; ----------------------------------------------- Sharing is Caring ------------------------------------------------+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:card-id/public_link""Generate publicly-accessible links for this Card. Returns UUID to be used in public links. (If this Card hasalready been shared, it will return the existing public link rather than creating a new one.) Public sharing must@@ -877,6 +881,8 @@{:public_uuid <>:made_public_by_id api/*current-user-id*})))}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :delete "/:card-id/public_link""Delete the publicly-accessible link to this Card."[{:keys [card-id]} :- [:mapdiff --git a/src/metabase/query_processor/api.clj b/src/metabase/query_processor/api.cljindex c69d466025b..4dc5815a56e 100644--- a/src/metabase/query_processor/api.clj+++ b/src/metabase/query_processor/api.clj@@ -164,6 +164,8 @@;;; ------------------------------------------------ Other Endpoints -------------------------------------------------+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/query_metadata""Get all of the required query metadata for an ad-hoc query."[_route-paramsdiff --git a/src/metabase/session/api.clj b/src/metabase/session/api.cljindex 2a065f0a9eb..7a667507467 100644--- a/src/metabase/session/api.clj+++ b/src/metabase/session/api.clj@@ -201,6 +201,8 @@(events/publish-event! :event/password-reset-initiated{:object (assoc user :token (t2/select-one-fn :reset_token :model/User :id user-id))}))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/forgot_password""Send a reset email when user has forgotten their password."[_route-params@@ -240,6 +242,8 @@"Throttler for password_reset. There's no good field to mark so use password as a default."(throttle/make-throttler :password :attempts-threshold 10))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/reset_password""Reset password with a reset token."[_route-params@@ -266,6 +270,8 @@(request/set-session-cookies request response session (t/zoned-date-time (t/zone-id "GMT"))))))(api/throw-invalid-param-exception :password (tru "Invalid reset token"))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/password_reset_token_valid""Check if a password reset token is valid and isn't expired."[_route-params@@ -279,6 +285,8 @@[](setting/user-readable-values-map (setting/current-user-readable-visibilities)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/google_auth""Login with Google Auth."[_route-paramsdiff --git a/src/metabase/setup/api.clj b/src/metabase/setup/api.cljindex c8c65466aae..68159d8e80c 100644--- a/src/metabase/setup/api.clj+++ b/src/metabase/setup/api.clj@@ -110,8 +110,8 @@;; return response with session ID and set the cookie as well(request/set-session-cookies request {:id session-key} session (t/zoned-date-time (t/zone-id "GMT"))))))-;; User defaults endpoint-+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/user_defaults""Returns object containing default user details for initial setup, if configured,and if the provided token value matches the token in the configuration value."diff --git a/src/metabase/sync/api/notify.clj b/src/metabase/sync/api/notify.cljindex 6485487c256..32d370d6a75 100644--- a/src/metabase/sync/api/notify.clj+++ b/src/metabase/sync/api/notify.clj@@ -64,6 +64,8 @@:schema_name schema-name:table_name table-name}))))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/db/attached_datawarehouse""Sync the attached datawarehouse. Can provide in the body:- table_name and schema_name: both strings. Will look for an existing table and sync it, otherwise will try to find adiff --git a/src/metabase/warehouse_schema/api/field.clj b/src/metabase/warehouse_schema/api/field.cljindex df6b8f3324c..9015a82f1c5 100644--- a/src/metabase/warehouse_schema/api/field.clj+++ b/src/metabase/warehouse_schema/api/field.clj@@ -265,6 +265,8 @@(api/check-500 (pos? updated-pk)))){:status :success})+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/rescan_values""Manually trigger an update for the FieldValues for this Field. Only applies to Fields that are eligible forFieldValues."@@ -279,6 +281,8 @@(field-values/create-or-update-full-field-values! field))){:status :success})+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/discard_values""Discard the FieldValues belonging to this Field. Only applies to fields that have FieldValues. If this Field'sDatabase is set up to automatically sync FieldValues, they will be recreated during the next cycle."diff --git a/src/metabase/warehouse_schema/api/table.clj b/src/metabase/warehouse_schema/api/table.cljindex 22d041ebd8f..fc2bf1cd98d 100644--- a/src/metabase/warehouse_schema/api/table.clj+++ b/src/metabase/warehouse_schema/api/table.clj@@ -184,6 +184,8 @@[:data_authority {:optional true} [:maybe ::data-authority-write]]]](update-tables! ids body))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/query_metadata""Get metadata about a `Table` useful for running queries.Returns DB, fields, field FKs, and field values.@@ -206,12 +208,16 @@:include-hidden-fields? include_hidden_fields:include-editable-data-model? include_editable_data_model}))+;; I think this endpoint can keep the `card__` part since it's a HACK to make IDs like `card__1` work+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/card__:id/query_metadata""Return metadata for the 'virtual' table for a Card."[{:keys [id]} :- [:map[:id ms/PositiveInt]]](first (schema.table/batch-fetch-card-query-metadatas [id] {:include-database? true})))+;; I think this endpoint can keep the `card__` part since it's a HACK to make IDs like `card__1` work+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/card__:id/fks""Return FK info for the 'virtual' table for a Card. This is always empty, so this endpointserves mainly as a placeholder to avoid having to change anything on the frontend."@@ -234,6 +240,8 @@:destination_id (:fk_target_field_id origin-field):destination (t2/hydrate (t2/select-one :model/Field :id (:fk_target_field_id origin-field)) :table)})))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/rescan_values""Manually trigger an update for the FieldValues for the Fields belonging to this Table. Only applies to Fields thatare eligible for FieldValues."@@ -251,6 +259,8 @@(sync/update-field-values-for-table! table)))){:status :success}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/discard_values""Discard the FieldValues belonging to the Fields in this Table. Only applies to fields that have FieldValues. Ifthis Table's Database is set up to automatically sync FieldValues, they will be recreated during the next cycle."@@ -336,6 +346,8 @@:file (get-in multipart-params ["file" :tempfile]):action :metabase.upload/replace}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/sync_schema""Trigger a manual update of the schema metadata for this `Table`."[{:keys [id]} :- [:mapdiff --git a/src/metabase/warehouses/api.clj b/src/metabase/warehouses/api.cljindex 4320bd1231e..885475a2a0d 100644--- a/src/metabase/warehouses/api.clj+++ b/src/metabase/warehouses/api.clj@@ -486,6 +486,8 @@[:in :table_id table-ids]always-false-hsql-expr)})+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/usage_info""Get usage info for a database.Returns a map with keys are models and values are the number of entities that use this database."@@ -666,6 +668,8 @@fields (readable-fields-only (autocomplete-fields db-id match-string limit))](autocomplete-results tables fields limit)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/autocomplete_suggestions""Return a list of autocomplete suggestions for a given `prefix`, or `substring`. Should only specify one, but`substring` will have priority if both are present.@@ -698,6 +702,8 @@(catch Throwable e(log/warnf e "Error with autocomplete: %s" (ex-message e)))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/card_autocomplete_suggestions""Return a list of `Card` autocomplete suggestions for a given `query` in a given `Database`.@@ -894,6 +900,8 @@;;; --------------------------------------- POST /api/database/sample_database ----------------------------------------+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/sample_database""Add the sample database as a new `Database`."[]@@ -1026,6 +1034,9 @@;;; ------------------------------------------ POST /api/database/:id/sync_schema -------------------------------------------;; Should somehow trigger sync-database/sync-database!+;;+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/sync_schema""Trigger a manual update of the schema metadata for this `Database`."[{:keys [id]} :- [:map@@ -1051,6 +1062,8 @@(sync/analyze-db! db)))){:status :ok}))))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/dismiss_spinner""Manually set the initial sync status of the `Database` and correspondingtables to be `complete` (see #20863)"@@ -1075,6 +1088,9 @@true);; Should somehow trigger cached-values/cache-field-values-for-database!+;;+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/rescan_values""Trigger a manual scan of the field values for this `Database`."[{:keys [id]} :- [:map@@ -1104,6 +1120,9 @@:where [:= :t.db_id (u/the-id database-or-id)]}]}));; TODO - should this be something like DELETE /api/database/:id/field_values instead?+;;+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :post "/:id/discard_values""Discards all saved field values for this `Database`."[{:keys [id]} :- [:map@@ -1135,6 +1154,8 @@schema-name))(current-user-can-manage-schema-metadata? database-id schema-name)))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:id/syncable_schemas""Returns a list of all syncable schemas found for the database `id`."[{:keys [id]} :- [:mapdiff --git a/src/metabase/xrays/api/automagic_dashboards.clj b/src/metabase/xrays/api/automagic_dashboards.cljindex b2102b19484..f004d3b55a4 100644--- a/src/metabase/xrays/api/automagic_dashboards.clj+++ b/src/metabase/xrays/api/automagic_dashboards.clj@@ -220,6 +220,8 @@(update dashboard :dashcards normalize-dashcards))](queries/batch-fetch-dashboard-metadata [(normalize-dashboard dashboard)])))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/:entity/:entity-id-or-query/query_metadata""Return all metadata for an automagic dashboard for entity `entity` with id `id`."[{:keys [entity entity-id-or-query]} :- [:map@@ -314,6 +316,8 @@:dashcard.background false:text.align_vertical :bottom}}])}))+;; TODO (Cam 10/28/25) -- fix this endpoint route to use kebab-case for consistency with the rest of our REST API+#_{:clj-kondo/ignore [:metabase/validate-defendpoint-route-uses-kebab-case]}(api.macros/defendpoint :get "/model_index/:model-index-id/primary_key/:pk-id""Return an automagic dashboard for an entity detail specified by `entity`with id `id` and a primary key of `indexed-value`."