I just pushed 0.7.0-beta-3. Not bothering with a formal release announcement, but this includes the fixes to the specs so that they operate in the correct namespace, and a few tweaks to the code that helps with writing responses.
I know that specs aren't for a fully precise description of the functions
but
https://github.com/pedestal/pedestal/blob/0.7.0-beta-3/service/src/io/pedestal/http/specs.clj
::http/service-map
Has ::http/port as required and ::http/routes as optional, and is used in http/create-servlet :args spec
using this form:
(require '[io.pedestal.http :as http]
'[io.pedestal.test :refer [response-for]])
(let [{::http/keys [service-fn]} (http/create-servlet {::http/port 3333
#_#_::http/routes #{}})]
(response-for service-fn :get "/"))
we can see that
• http/routes is required
• http/port is not required
The same for http/create-server. And more. You define http/port as a pos-int?, that exclude 0, that is a valid value (it takes a "random availble port", in jetty, not sure other engines).Thanks for looking at this.
Much of this is not the way I would have liked to see it set up on day 1, but I wasn't here on day 1.
Really, what's missing is a sense of all the combinations of keys that are needed.
http/routes isn't required, because it isn't needed when :http/router is supplied.
I think these specs are useful in terms of if you supply a value it is checked by the specs. It does a worse job of ensuring that a consistent set of keys/values are supplied.
Also, documentation changes.