(bootstrap api-root concise-handlers & [{:keys [produces consumes] :as opts}])Creates a Martian instance from the given concise-handlers description.
Supported options:
:interceptors — an ordered coll of Tripod interceptors to be used
as a global interceptor chain by Martian instance;
defaults to the default-interceptors;:validate-handlers? — if true, will enable early validation of handlers,
failing fast in case of errors; false by default;:coercion-matcher — a unary fn of schema used for parameters coercion;
defaults to the default-coercion-matcher;:produces — a coll of media (content) types used as a global
default value for the handler's :produces key;:consumes — a coll of media (content) types used as a global
default value for the handler's :consumes key.Creates a Martian instance from the given `concise-handlers` description.
Supported options:
- `:interceptors` — an ordered coll of Tripod interceptors to be used
as a global interceptor chain by Martian instance;
defaults to the `default-interceptors`;
- `:validate-handlers?` — if true, will enable early validation of handlers,
failing fast in case of errors; false by default;
- `:coercion-matcher` — a unary fn of schema used for parameters coercion;
defaults to the `default-coercion-matcher`;
- `:produces` — a coll of media (content) types used as a global
default value for the handler's `:produces` key;
- `:consumes` — a coll of media (content) types used as a global
default value for the handler's `:consumes` key.(bootstrap-openapi api-root json & [opts])Creates a Martian instance from an OpenAPI/Swagger spec based on the json
schema provided.
Supported options:
:interceptors — an ordered coll of Tripod interceptors to be used
as a global interceptor chain by Martian instance;
defaults to the default-interceptors;:validate-handlers? — if true, will enable early validation of handlers,
failing fast in case of errors; false by default;:coercion-matcher — a unary fn of schema used for parameters coercion;
defaults to the default-coercion-matcher;:use-defaults? — if true, will read 'default' directives from the
OpenAPI/Swagger spec; false by default;:route-name-sources — a vector of route name sources; supported sources:
- :operationId — use an "operationId" property
- :method+path — use method + URL (path) pattern
- any fn of 'url-pattern', 'method', 'definition';
defaults to [:operationId].Creates a Martian instance from an OpenAPI/Swagger spec based on the `json`
schema provided.
Supported options:
- `:interceptors` — an ordered coll of Tripod interceptors to be used
as a global interceptor chain by Martian instance;
defaults to the `default-interceptors`;
- `:validate-handlers?` — if true, will enable early validation of handlers,
failing fast in case of errors; false by default;
- `:coercion-matcher` — a unary fn of schema used for parameters coercion;
defaults to the `default-coercion-matcher`;
- `:use-defaults?` — if true, will read 'default' directives from the
OpenAPI/Swagger spec; false by default;
- `:route-name-sources` — a vector of route name sources; supported sources:
- `:operationId` — use an "operationId" property
- `:method+path` — use method + URL (path) pattern
- any fn of 'url-pattern', 'method', 'definition';
defaults to `[:operationId]`.(bootstrap-swagger api-root json & [opts])Creates a Martian instance from an OpenAPI/Swagger spec based on the json
schema provided.
Supported options:
:interceptors — an ordered coll of Tripod interceptors to be used
as a global interceptor chain by Martian instance;
defaults to the default-interceptors;:validate-handlers? — if true, will enable early validation of handlers,
failing fast in case of errors; false by default;:coercion-matcher — a unary fn of schema used for parameters coercion;
defaults to the default-coercion-matcher;:use-defaults? — if true, will read 'default' directives from the
OpenAPI/Swagger spec; false by default;:route-name-sources — a vector of route name sources; supported sources:
- :operationId — use an "operationId" property
- :method+path — use method + URL (path) pattern
- any fn of 'url-pattern', 'method', 'definition';
defaults to [:operationId].Creates a Martian instance from an OpenAPI/Swagger spec based on the `json`
schema provided.
Supported options:
- `:interceptors` — an ordered coll of Tripod interceptors to be used
as a global interceptor chain by Martian instance;
defaults to the `default-interceptors`;
- `:validate-handlers?` — if true, will enable early validation of handlers,
failing fast in case of errors; false by default;
- `:coercion-matcher` — a unary fn of schema used for parameters coercion;
defaults to the `default-coercion-matcher`;
- `:use-defaults?` — if true, will read 'default' directives from the
OpenAPI/Swagger spec; false by default;
- `:route-name-sources` — a vector of route name sources; supported sources:
- `:operationId` — use an "operationId" property
- `:method+path` — use method + URL (path) pattern
- any fn of 'url-pattern', 'method', 'definition';
defaults to `[:operationId]`.The default coercion matcher used by Martian for parameters coercion.
The default coercion matcher used by Martian for parameters coercion.
The vector with default interceptors used to build a Martian instance.
The vector with default interceptors used to build a Martian instance.
(explore martian)(explore martian route-name)Explores the given Martian instance or a particular handler with the given
route-name, if any.
Returns a map containing details such as:
:route-name and :summary — for the Martian instance, or:summary, :parameters, and :returns — for the handler.Explores the given Martian instance or a particular handler with the given `route-name`, if any. Returns a map containing details such as: - `:route-name` and `:summary` — for the Martian instance, or - `:summary`, `:parameters`, and `:returns` — for the handler.
(handler-for martian route-name)Given a Martian instance, returns a handler for the given route-name.
Given a Martian instance, returns a handler for the given `route-name`.
(request-for martian route-name)(request-for martian route-name params)Given a Martian instance, builds an HTTP request for the given route-name
using the provided params, if any.
Given a Martian instance, builds an HTTP request for the given `route-name` using the provided `params`, if any.
(response-for martian route-name)(response-for martian route-name params)Given a Martian instance, makes an HTTP request for the given route-name
using the provided params, if any, and returns the HTTP response.
Given a Martian instance, makes an HTTP request for the given `route-name` using the provided `params`, if any, and returns the HTTP response.
(update-handler martian route-name update-fn & update-args)Given a Martian instance, updates a handler with the provided route-name
using the provided update-fn and update-args, if any.
For example, route-specific interceptors can be added like that:
(update-handler m :load-pet assoc :interceptors [an-interceptor])
Given a Martian instance, updates a handler with the provided `route-name` using the provided `update-fn` and `update-args`, if any. For example, route-specific interceptors can be added like that: ``` (update-handler m :load-pet assoc :interceptors [an-interceptor]) ```
(url-for martian route-name)(url-for martian route-name params)(url-for martian route-name params {:keys [include-query?] :as _options})Given a Martian instance, builds a request URL for the given route-name
using the provided params and options, if any.
Supported options:
:include-query? — if true, will include params in the URL query string;
false by default.Given a Martian instance, builds a request URL for the given `route-name`
using the provided `params` and options, if any.
Supported options:
- `:include-query?` — if true, will include params in the URL query string;
false by default.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |