        x))})
 
 (def SingleSchemeMapping
-  {(merge AuthSchemes Authorization NamespacedEntries)
+  {RealmValue
    (fn [x]
      (if (:verify x)
        (-> x

   :known-methods {s/Keyword s/Any}
   :interceptor-chain [(s/=> Context Context)]
   (s/optional-key :path-info?) s/Bool})


(def r (resource-coercer
     {:access-control {:realm "default"
                       :scheme "Basic"
                       :verify identity
                       :authorization {:roles/methods {:get :admin}}
                       :allow-origin "*"}}))


   (s/optional-key :allow-methods) (s/conditional fn? ContextFunction :else Keywords)
   (s/optional-key :allow-headers) (s/conditional fn? ContextFunction :else Strings)})

(s/defschema AccessControlValue
  (merge Realms Cors NamespacedEntries))

(s/defschema AccessControl
  {(s/optional-key :access-control) AccessControlValue})

;; Here is some tricky code, caused by the necessity to compose the
;; 'data macros'. The realm short-hand has to rewrite the data, which
;; may include the scheme in short or long form, which makes it
;; difficult to find an approach that preserves schema integrity while
;; decoupling the data macros from each other. The consequence is that
;; these mappings have some intimate knowledge of each other's
;; structure, but the trade-off of more difficult maintenance is
;; deemed worth it for the value to the user of being able to use
;; short-hands. For an explanation of data macros, see
;; https://blog.juxt.pro/posts/data-macros.html

(def SingleRealmMapping
  {AccessControlValue
   (fn [x]
     (if-let [realm (:realm x)]
       (-> x
