 
 (s/defschema Context {})
 
+(defn resolve-dynamic
+  "P"
+  [f ctx]
+  (if (fn? f)
+    (f ctx)
+    f))
+
+(defmacro maybe-dynamic
+  "Return a schema that allows for a value to be dynamic, resolved at
+  request-time with resolve-dynamic."
+  [t]
+  `(s/conditional
+    fn? (s/=> ~t Context)
+    :else ~t))
+
 (s/defschema ContextFunction
   (s/=> s/Any Context))
 
 (s/defschema Produces
-  {(s/optional-key :produces) (s/conditional
-                               fn? ContextFunction
-                               :else [Representation])})
+  {(s/optional-key :produces) (maybe-dynamic [Representation])})
+
 (s/defschema Consumes
-  {(s/optional-key :consumes) (s/conditional
-                               fn? ContextFunction
-                               :else [Representation])})
+  {(s/optional-key :consumes) (maybe-dynamic [Representation])})
 
 (s/defschema Response
   {:response ContextFunction})

          (s/optional-key :exists?) s/Bool}
         NamespacedEntries))

(s/defschema PropertiesHandlerFunction
  (s/=> PropertiesResult Context))

(s/defschema Properties
  {(s/optional-key :properties) (s/conditional
                                 fn? PropertiesHandlerFunction
                                 :else PropertiesResult)})

(def PropertiesMappings {})


   NamespacedEntries))

(s/defschema AuthSchemes
  {(s/optional-key :authentication-schemes) (maybe-dynamic [AuthScheme])})

;; Authorization can contain any content because it is up to the
;; authorization interceptor, which is pluggable.
