Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: metosin/compojure-api

1.0.0

17 Feb 14:04
1.0.0
This tag was signed with the committer’sverified signature.
Deraen Juho Teperi
GPG key ID:094224808950366D
Verified
Learn about vigilant mode.

Choose a tag to compare

compare

  • updated dependencies:
[prismatic/schema"1.0.5"] is available but weuse"1.0.4"
Assets2
Loading

1.0.0-RC2

17 Feb 14:05

Choose a tag to compare

1.0.0-RC2Pre-release
Pre-release

compare

  • Swagger-routes mounted via api-options are mounted before other routes, fixes#218
  • Routes are now resolved also from from Vars, fixes#219
  • Better handling of:basePath withswagger-routes, thanks toHoxu.
  • Updated dependencies:
[metosin/ring-swagger"0.22.4"] is available but weuse"0.22.3"
Loading

1.0.0-RC1

17 Feb 14:05

Choose a tag to compare

1.0.0-RC1Pre-release
Pre-release

compare

  • Move from compile-time to runtime route resolution.
    • Most of the internal macro magic has been vaporized
    • Uses internally (invokable) Records & Protocols, allowing easier integration to 3rd party libs likeLiberator
      • even for large apps (100+ routes), route compilation takes now millis, instead of seconds
    • sub-routes can be created with normal functions (or values), making it easier to:
      • pass in app-level dependencies from libs likeComponent
      • reuse shared request-handling time parameters like path-parameters and authorization info
(defnmore-routes [db version]  (routes    (GET"/version" []      (ok {:version version}))    (POST"/thingie" []      (ok (thingie/create db)))))(defnapp [db]  (api    (context"/api/:version" []:path-params [version:- s/Str]      (more-routes db version)      (GET"/kikka" []        (ok"kukka")))))

Breaking changes

  • BREAKING Vanilla Compojure routes will not produce any swagger-docs (as they do not satisfy the
    Routing protocol. They can still be used for handling request, just without docs.
    • a new api-level option[:api :invalid-routes-fn] to declare how to handle routes not satisfying
      theRouting protocol. Default implementation logs invalid routes as WARNINGs.
  • BREAKING compojure.core imports are removed fromcompojure.api.sweet:
    • let-request,routing,wrap-routes
  • BREAKING Asterix (*) is removed from route macro & function names, as there is no reason to mix compojure-api & compojure route macros.
    • GET* =>GET
    • ANY* =>ANY
    • HEAD* =>HEAD
    • PATCH* =>PATCH
    • DELETE* =>DELETE
    • OPTIONS* =>OPTIONS
    • POST* =>PUT
    • context* =>context
    • defroutes* =>defroutes
  • BREAKINGswagger-docs andswagger-ui are now longer incompojure.api.sweet
    • Syntax was hairy and when configuring the spec-url it needed to be set to both in order to work
    • In future, there are multiple ways of setting the swagger stuff:
      • via api-options:swagger (has no defaults)
      • viaswagger-routes function, mounting both theswagger-ui andswagger-docs and wiring them together
        • by default, mounts the swagger-ui to/ and the swagger-spec to/swagger.json
      • via the oldswagger-ui &swagger-docs (need to be separately imported fromcompojure.api.swagger).
      • seehttps://github.com/metosin/compojure-api/wiki/Swagger-integration for details
(defapiapp  (swagger-routes)  (GET"/ping" []    (ok {:message"pong"})))(defapiapp  {:swagger {:ui"/",:spec"/swagger.json"}}  (GET"/ping" []    (ok {:message"pong"})))
  • BREAKING: api-level coercion option is now a function ofrequest => type => matcher as it is documented.
    Previously required atype => matcher map. Options are checked againsttype => matcher coercion input, and a
    descriptive error is thrown when api is created with the old options format.
  • BREAKING: Renamedmiddlewares tomiddleware and:middlewares key (restructuring) to:middleware
    • will break at macro-expansion time with helpful exception
  • BREAKING: Middleware must be defined as data: both middleware macro and :middleware restructuring
    take a vector of middleware containing either
    • a) fully configured middleware (function), or
    • b) a middleware templates in form of[function args]
    • You can also use anonymous or lambda functions to create middleware with correct parameters,
      these are all identical:
      • [[wrap-foo {:opts :bar}]]
      • [#(wrap-foo % {:opts :bar})]
      • [(fn [handler] (wrap-foo handler {:opts :bar}))]
    • Similar toduct
  • BREAKING: (Custom restructuring handlers only):parameters key used byrestructure-param
    has been renamed to:swagger.
    • will break at macro-expansion time with helpful exception
  • BREAKINGpublic-resource-routes &public-resources are removed fromcompojure.api.middleware.
  • BREAKING:compojure.api.legacy namespace has been removed.

Migration guide

https://github.com/metosin/compojure-api/wiki/Migration-Guide-to-1.0.0

Other stuff

  • Additional route functions/macros incompojure.api.core:
    • routes &letroutes, just like in the Compojure, but supportingRouting
    • undocumented - works just likeroutes but without any route definitions. Can be used to wrap legacy routes which setting the api option to fail on missing docs.
  • top-levelapi is now just function, not a macro. It takes an optional options maps and a top-level route function.
  • Coercer cache is now at api-level with 10000 entries.
  • Code generated from restructured route macros is much cleaner now
  • Coercion is on by default for standalone (apiless) endpoints.
(fact"coercion is on for apiless routes"  (let [route (GET"/x" []:query-params [x:- Long]                (ok))]    (route {:request-method:get:uri"/x":query-params {}}) =>throws))
  • Removed deps:
[backtick"0.3.3"]
Loading

0.24.5

17 Jan 18:47
0.24.5
This tag was signed with the committer’sverified signature.
Deraen Juho Teperi
GPG key ID:094224808950366D
Verified
Learn about vigilant mode.

Choose a tag to compare

compare

[metosin/ring-swagger"0.22.3"] is available
Loading

0.24.4

17 Jan 18:47

Choose a tag to compare

compare

[metosin/ring-swagger"0.22.2"] is available[metosin/ring-swagger-ui"2.1.4-0"] is available[potemkin"0.4.3"] is available
Loading

0.24.3

17 Jan 18:47

Choose a tag to compare

compare

  • coercer-cache is now per Route instead beeing global and based on a
    FIFO size 100 cache. Avoids potential memory leaks when using anonymous coercion matchers (which never hit the cache).
  • Updated deps:
[prismatic/schema"1.0.4"] is available but weuse"1.0.3"
Loading

0.24.2

17 Jan 18:47

Choose a tag to compare

compare

  • Memoize coercers (forschema &matcher -input) for better performance.
    • Tests show 0-40% lower latency,
      depending on input & output schema complexity.
    • Tested by sending json-strings toapi and reading json-string out.
    • Measured a 80% lower latency with a real world large Schema.
  • Updated deps:
[potemkin"0.4.2"] is available but weuse"0.4.1"
Loading

0.24.1

17 Jan 18:46

Choose a tag to compare

compare

  • uses[Ring-Swagger "0.22.1"]
  • clojure.tools.logging is used with default uncaugt exception handling if it's found
    on the classpath. Fixes#172.
  • Bothapi anddefapi produce identical swagger-docs. Fixes#159
  • allow any swagger data to be overriden at runtime either via swagger-docs or via middlewares. Fixes#170.
[metosin/ring-swagger"0.22.1"] is available but weuse"0.22.0"[metosin/ring-swagger-ui"2.1.3-4"] is available but weuse"2.1.3-2"[prismatic/plumbing"0.5.2] is available but we use"0.5.1"
Loading

0.24.0

08 Nov 10:26

Choose a tag to compare

compare

  • BREAKING: Dropped support for Clojure 1.6
  • BREAKING: Supports and depends on Schema 1.0.
  • Uses upstreamring-middleware-format
    instead of Metosin fork.
  • Uses nowlinked instead of
    ordered for maps where order matters.
  • swagger-ui now supports passing arbitrary options toSwaggerUI
    (metosin/ring-swagger#67).
  • Updated deps:
[prismatic/schema"1.0.3"] is available but weuse"0.4.4"[prismatic/plumbing"0.5.1] is available but we use"0.4.4"[metosin/schema-tools"0.7.0"] is available but we use"0.5.2"[metosin/ring-swagger"0.22.0"] is available but we use"0.21.0"[metosin/ring-swagger-ui"2.1.3-2"] is available but we use"2.1.2"
Loading

0.23.1

08 Nov 10:26

Choose a tag to compare

compare

  • Routes are kept in order for swagger docs, Fixes#138.
Loading
Previous134
Previous

[8]ページ先頭

©2009-2025 Movatter.jp