Commit graph

782 commits

Author SHA1 Message Date
Juho Teperi
d4a85c40e6 Revert group id change
Per discussions in Slack, changing the group id causes too much problems
2023-10-03 13:06:23 +03:00
Tommi Reiman
6a39dcd6ec 0.7.0-alpha6 2023-09-11 15:03:31 +03:00
Joel Kaasinen
ccc2b5636e move all libs metosin/reitit => fi.metosin/reitit
metosin/ is a clojars legacy group, and new modules like
fi.metosin/openapi can't be created under it. Let's move everything
under fi.metosin
2023-09-11 11:04:36 +03:00
Joel Kaasinen
bad798d90d feat: allow vectors for openapi/swagger :tags
no need to insist on set, and many of our examples use vectors anyway
2023-09-11 07:59:17 +03:00
Joel Kaasinen
b4c0936207 Merge remote-tracking branch 'origin/master' into fix-openapi-examples 2023-09-11 07:53:15 +03:00
Joel Kaasinen
5352fd4f99 fix: swagger & openapi ::tags spec
`#{}` isn't a valid :kind predicate
2023-09-11 07:40:13 +03:00
Joel Kaasinen
b206fc79b3 fix: spec for openapi-feature 2023-09-11 07:12:00 +03:00
Joel Kaasinen
7352358662 feat: rename openapi :content-types keyword, split for req & resp 2023-09-08 15:17:35 +03:00
Paulo Rafael Feodrippe
68adf50362
Remove duplicated :operationId 2023-09-07 16:39:39 -04:00
Joel Kaasinen
497da675b9 refactor: use update-vals 2023-09-01 10:37:17 +03:00
Joel Kaasinen
241c8367e3 feat: dissoc definitions from swagger methods
we only want the definitions on the very top level of the swagger doc
2023-08-30 09:38:33 +03:00
Joel Kaasinen
b316840ea0 fix: compile instead of -compile-model in malli.cljc
-compile-model now takes a vector of models, so
(-compile-model this model nil) fails. Just use compile directly like
master does.
2023-08-30 09:38:33 +03:00
Joel Kaasinen
f1d26791fc Merge branch 'master' into rework-pr-589 2023-08-30 08:29:06 +03:00
Joel Kaasinen
85ebb343ed refactor: remove dead code 2023-08-28 13:48:28 +03:00
Joel Kaasinen
d5021e549a fix: pick up openapi examples from [:responses _ :content :default] 2023-08-28 13:48:23 +03:00
Joel Kaasinen
25aee5ed22 Merge remote-tracking branch 'origin/master' into fix-openapi-example 2023-08-28 13:01:58 +03:00
Joel Kaasinen
e4c75c7354 fix: dissoc unsupported [:responses nnn :content] for swagger
otherwise swagger generation crashes when it tries to serialize
something like `{:content {"foo/bar" any?}}`

also fix examples/ring-malli-swagger
2023-08-28 11:18:00 +03:00
Joel Kaasinen
8af89c05cb refactor: get rid of reitit.coercion/get-apidocs 2023-08-28 10:06:14 +03:00
Joel Kaasinen
233ac19914 refactor: remove dead code 2023-08-28 10:03:07 +03:00
Joel Kaasinen
6f111bce2e refactor: share -get-apidocs-openapi between malli, spec & schema 2023-08-28 09:24:10 +03:00
Joel Kaasinen
051452231a refactor: -get-model-apidocs for schema & spec
not used yet tho
2023-08-28 09:02:11 +03:00
Joel Kaasinen
f943b025cb refactor: no need to pass options into -get-apidocs-openapi 2023-08-28 08:59:58 +03:00
Joel Kaasinen
ee298ec362 refactor: Coercion.-get-model-apidocs, use it for malli openapi 2023-08-28 08:42:54 +03:00
Joel Kaasinen
803ed0933a refactor: parameterise -get-apidocs-openapi with ->schema-object 2023-08-24 11:05:43 +03:00
Tommi Reiman
b0c810a981
Merge pull request #628 from metosin/openapi-parameters
Openapi parameters
2023-08-24 09:25:46 +03:00
Tommi Reiman
05cbed815f review comment fixes 2023-08-24 08:38:18 +03:00
Tommi Reiman
adef7ad06e read openapi metadata into openapi description 2023-08-23 16:43:34 +03:00
Tommi Reiman
226ca889b6 openapi content tests 2023-08-18 17:17:56 +03:00
Tommi Reiman
d8e9819e0a fix responses & request 2023-08-18 16:47:20 +03:00
Juho Teperi
4a182588b4 Release 0.7.0-alpha5 2023-06-14 16:06:20 +03:00
Juho Teperi
a032abc910 Fix interceptors deps 2023-06-12 18:15:53 +03:00
Juho Teperi
cf5906030a Reitit-dev fixes 2023-06-12 17:57:51 +03:00
Juho Teperi
ac410507f2 Fix reitit-dev deps 2023-06-12 17:50:10 +03:00
Tommi Reiman
b1404ada6d top-level :request coercion & stuff 2023-05-28 16:49:08 +03:00
Tommi Reiman
93a4246682 allow default 2023-05-28 12:07:01 +03:00
Tommi Reiman
d17c97780e wrap :content schemas in :schema 2023-05-27 19:01:17 +03:00
Tommi Reiman
3e6c3f589f review comments 2023-05-22 20:23:47 +03:00
Tommi Reiman
9ac713f0e5 doesn't work properly with spec 2023-05-22 09:16:57 +03:00
Tommi Reiman
ce06214014 welcome 2-phase schema compilation
1) use `:update-paths` to handle data in certain (loose) paths differently
  - accumulate schemas in all relevant routers into vector
  - we do not know the coercion here (ring/http have special handling of data, e.g. http-methods)

2) run coercion compiler for the model to merge the effective model
  - schema + malli = should work ok, spec = best effort

3) publish final schemas into compiled route data
2023-05-21 20:32:40 +03:00
Tommi Reiman
3f265888a4 cleanup 2023-05-21 20:16:45 +03:00
Tommi Reiman
550ea6da58 path-update 2023-05-21 20:13:43 +03:00
Tommi Reiman
4d0e40f135 ctrl.* is such test 2023-05-21 18:15:44 +03:00
Tommi Reiman
d45dd151b7 document meta-merge 2023-05-21 18:11:42 +03:00
Tommi Reiman
b3383b0396 0.7.3-alpha4 2023-05-17 18:23:05 +03:00
Joel Kaasinen
b56c15b64c fix: openapi malli parameter descriptions
... should come from the parameter type, not from the parent :map
2023-05-17 08:19:44 +03:00
Juho Teperi
0b6ed62738 Release 0.7.0-alpha3 2023-05-05 12:57:31 +03:00
Juho Teperi
5adc5ffba0 Compile reitit.Trie with Java 1.8 target 2023-05-05 12:56:02 +03:00
Juho Teperi
e1f9cfb286 Fix versions 2023-05-05 11:18:38 +03:00
Juho Teperi
e204d4ff1b Release 0.7.0-alpha2 2023-05-04 15:20:31 +03:00
Juho Teperi
9f6565f097
Merge pull request #604 from metosin/fix-377-fragment-strings
Fix #377, navigate to routes with fragment string in frontend
2023-05-04 15:12:41 +03:00
Juho Teperi
b9f189b3f7 Fix Html5History missing fragment on initial load 2023-05-04 15:05:27 +03:00
Tommi Reiman
f015b6669a fi 2023-05-03 15:41:11 +03:00
Tommi Reiman
3336880b01 0.7.0-alpha1 2023-05-03 10:25:01 +03:00
Wes Morgan
f237b0942e
Merge branch 'master' into fix/malli-swagger-defs 2023-04-17 09:44:36 -06:00
Joel Kaasinen
33f7b1ccd7 chore: upgrade lein-parent plugin 2023-04-13 09:23:08 +03:00
Juho Teperi
56e6dbe8d8 Fix #377, navigate to routes with fragment string in frontend 2023-03-24 14:42:13 +02:00
Juho Teperi
e2217887e3 Comments about differences to reitit.impl 2023-03-24 13:59:02 +02:00
Juho Teperi
dad8f530a6 Add example and update docs 2023-03-24 11:32:22 +02:00
Juho Teperi
48bbdba8ed Implement navigate and set-query functions 2023-03-24 11:16:09 +02:00
Juho Teperi
e3e93eaffb Add some tests 2023-03-23 15:36:48 +02:00
Juho Teperi
dd724f0d0e Fix #600: Add frontend function to update query-params for current path 2023-03-23 15:13:27 +02:00
Wes Morgan
0f9b624124
Merge branch 'master' into fix/malli-swagger-defs 2023-03-18 11:32:03 -06:00
Joel Kaasinen
d8e28e153b fix: swagger multipart support
1. For spec we were including some extra stuff in the parameter
specification:

{:description "",
 :in "formData",
 :name "file",
 :properties {"bytes" {:format "byte", :type "string"},
              "content-type" {:type "string"},
              "filename" {:type "string"}},
 :required ["filename" "content-type" "bytes"],
 :type "file"}

2. For malli the :type changed from "file" to "string" because of
openapi changes. Now openapi and swagger both get the right type.

3. Test for swagger multipart support
2023-03-17 14:54:46 +02:00
Joel Kaasinen
b5c9ee274d feat: generate correct openapi for reitit.ring.malli 2023-03-16 09:57:02 +02:00
Joel Kaasinen
acbcec1ed9 feat: openapi3 multipart support for schema 2023-03-15 17:48:03 +02:00
Joel Kaasinen
1c65f533cf feat: openapi3 multipart support for malli 2023-03-15 17:48:03 +02:00
Joel Kaasinen
f322597c04 feat: openapi3 multipart support for spec 2023-03-15 17:48:03 +02:00
Joel Kaasinen
bcd12d9f31 refactor: push openapi/openapi-spec call inside merge
to make reitit.coercion.spec match reitit.coercion.schema
2023-03-15 13:38:34 +02:00
Joel Kaasinen
6f72acdf32 doc: fix example in openapi-feature docstring 2023-03-15 09:24:27 +02:00
Joel Kaasinen
814c8b88e2 refactor: factor out -identity-coercer 2023-03-14 14:39:05 +02:00
Joel Kaasinen
bbaf4b27f7 refactor: remove commented-out code 2023-03-14 14:37:53 +02:00
Tommi Reiman
11f47527f1 add reitit-openapi module, 0.5.18 -> 0.6.0 2023-03-14 12:24:05 +02:00
Joel Kaasinen
3fa50ea0f6 doc: mark openapi support as alpha 2023-03-10 10:17:42 +02:00
Joel Kaasinen
8c87fef7b6 feat: warning when swagger encounters per-content-type coercions 2023-03-10 08:52:45 +02:00
Joel Kaasinen
ae55b6628c doc: update docstring of openapi-feature 2023-03-09 10:21:46 +02:00
Joel Kaasinen
50c1af9a5b feat: route data validation for per-content-type coercions 2023-03-08 14:39:52 +02:00
Joel Kaasinen
9ae3cd0824 fix: reitit.openapi route data validation
:kind set? would've worked, but there's no need to insist a set

also, turn on route data validation in openapi_test.clj
2023-03-08 14:39:52 +02:00
Wes Morgan
4f31304a1a
Lift definitions to root of swagger.json
...so that all of the absolute $ref's to them will resolve
2023-03-06 12:16:48 -07:00
Wes Morgan
229171c7e3
Move more of swagger gen into malli lib
...so we can fix #558.
2023-03-06 12:15:20 -07:00
Joel Kaasinen
4c990fb44f feat: openapi default request/response schemas
use a default schema from :request/:response :body for all specified
:content-types
2023-03-06 10:58:03 +02:00
Joel Kaasinen
c3a3ca9f95 feat: change syntax for :request parameter coercion default schema
use :request :body instead of :request :content :default for symmetry
with :response
2023-03-06 10:54:24 +02:00
Joel Kaasinen
7842160656 Merge remote-tracking branch 'origin/master' into openapi 2023-03-03 14:43:23 +02:00
Joel Kaasinen
2d60702769 fix: per-content-type openapi w/ spec 2023-03-03 14:15:31 +02:00
Joel Kaasinen
c8d679c6b3 feat: per-content-type request/response coercions
implemented on the reitit-core level so individual coercions don't
need changes

syntax:

{:parameters {:request {:content {"application/edn" [:map ...]}}}
 :responses {200 {:content {"application/edn" [:map ...]}}}}
2023-03-03 14:15:31 +02:00
Tommi Reiman
47f1ee0c84 0.6.0 2023-02-21 15:17:00 +02:00
Ilmo Raunio
310dcd0e99
Merge pull request #581 from metosin/add-support-for-fragment-parameters-2
Add reitit-frontend support for fragment string
2023-02-21 15:05:25 +02:00
Juho Teperi
2494f702d9 Read fragment string without decoding
Users can use Malli decoding to control decoding per schema.
2023-02-16 13:13:48 +02:00
Juho Teperi
83c31e35bc Revert "Revert "Merge pull request #554 from just-sultanov/add-support-for-fragment-parameters""
This reverts commit 4d1b00edfa.
2023-02-16 11:53:27 +02:00
Chris Badahdah
999f6c3dbd Allow var handlers 2023-01-31 16:04:28 -07:00
Tommi Reiman
d1bb44a88f
Merge branch 'master' into reloading-ring-handler 2023-01-22 14:30:06 +02:00
Tommi Reiman
0648296315
Merge branch 'master' into feature/openapi 2023-01-22 14:29:22 +02:00
Tommi Reiman
3fd20f2294 reloading-ring-handler 2023-01-22 14:15:08 +02:00
Tommi Reiman
8e1e7e62ca fix spec tests + format 2023-01-21 10:58:53 +02:00
Tommi Reiman
f27c2fc2aa clean 2023-01-21 10:56:42 +02:00
Tommi Reiman
98a4d9b447 :meta-merge-fn -> :meta-merge 2023-01-21 10:56:42 +02:00
Tommi Reiman
3ec5acc7a1
Merge pull request #582 from ilmoraunio/issue-565
Include query-string as part of location header in redirect-trailing-slash-handler
2023-01-21 10:51:20 +02:00
Tommi Reiman
22fb9810a7
Merge pull request #552 from frwdrik/patch-1
Remove redundant s/and
2023-01-21 10:43:26 +02:00
Ilmo Raunio
0870b20a05 Add query-string to redirect-trailing-slash-handler 2023-01-20 00:20:10 +02:00
Juho Teperi
4d1b00edfa Revert "Merge pull request #554 from just-sultanov/add-support-for-fragment-parameters"
This reverts commit c2c267f4d8, reversing
changes made to 8087522b82.
2023-01-18 18:38:47 +02:00
Tommi Reiman
c2c267f4d8
Merge pull request #554 from just-sultanov/add-support-for-fragment-parameters
Add support for fragment parameters in the reitit-frontend module
2023-01-09 17:33:24 +02:00
Tommi Reiman
42e988e518
Merge branch 'master' into support-operationid 2023-01-09 17:27:00 +02:00
Tommi Reiman
23c20dc44e
Merge pull request #557 from handerpeder/master
Polish pedestal chains when printing context diffs
2023-01-09 17:18:39 +02:00
Tommi Reiman
af441e6154
Merge pull request #569 from SagaHealthcareIT/swagger-operationid-support
Swagger: support operationId in generated swagger json
2023-01-09 17:14:10 +02:00
Tommi Reiman
26a581298a
Merge pull request #561 from pfeodrippe/meta-merge
add `:meta-merge-fn` option
2023-01-09 16:39:12 +02:00
Ben Sless
24f38e0dfa Unroll merge and hash-map coercion 2022-12-06 21:35:26 +02:00
Ben Sless
8398c98595 Add serialize-failed-result coercion option
False by default, if true will serialize the failed coercion result in
the error message
2022-12-06 21:34:13 +02:00
Ben Sless
bc4443a935 Remove schema and errors from default malli coercion error keys 2022-12-06 21:20:48 +02:00
Fredrik Vaeng Røtnes
edee97a550
Rename variable handle -> handler 2022-12-05 13:06:27 +00:00
Jesse Dowell
148fa2167b
Swagger: support operationId in generated swagger json 2022-11-13 18:54:43 -05:00
Toni Väisänen
c69b4cde3a Handle empty seq as empty string in query-string
example:

instead of

```clojure
(query-string {:nil nil
               :vec []
               :seq-empty '()})
;; => "nil=&&"
```

now

```clojure
(query-string {:nil nil
               :vec []
               :seq-empty '()})
;; => "nil=&vec=&seq-empty="
```
2022-10-12 13:24:07 +03:00
Enzzo Cavallo
c576b47634
OpenAPI V3 Support 2022-09-05 03:21:53 -03:00
Paulo Feodrippe
fc73d02e01 add :meta-merge-fn option 2022-08-11 07:55:15 -04:00
Peder Refsnes
4e14b1f05e Polish pedestal chains when printing context diffs 2022-07-19 22:33:28 +02:00
Ilshat Sultanov
25a051b003
Add support for fragment parameters in the reitit-frontend module
We have to process the fragment parameters due to the fact that the authorization server returns a callback in the following format:
`https://example.com/oauth/google/callback#access_token=foo&refresh_token=bar&provider_token=baz&token_type=bearer&expires_in=3600`

Links:
- https://www.rfc-editor.org/rfc/rfc6749#section-4.2
- https://www.rfc-editor.org/rfc/rfc6749#section-4.2.2
2022-06-15 23:38:51 +05:00
Fredrik Vaeng Røtnes
aeab5b96a6
Remove redundant s/and 2022-05-09 10:36:40 +00:00
Tommi Reiman
3dff4c84aa 0.5.18 2022-04-05 21:38:04 +03:00
Tommi Reiman
4e40d3e2c9
Merge pull request #537 from frwdrik/master
Save three seq constructions
2022-04-05 21:34:56 +03:00
Tommi Reiman
40bf16857f doc the option 2022-04-05 21:22:36 +03:00
Tommi Reiman
1ecfd1ae02 CHANGELOG, pass match too 2022-04-05 17:55:09 +03:00
Tommi Reiman
9e4b420fc8 on-coercion-error 2022-04-05 17:33:25 +03:00
Fredrik Vaeng Røtnes
43d6f52208
Update spec.cljc
Stray character
2022-03-18 15:55:20 +00:00
Tommi Reiman
f0405adc02 0.5.17 2022-03-10 20:15:43 +02:00
Tommi Reiman
b0602d60c9 one more time 2022-03-10 15:21:15 +02:00
Tommi Reiman
f9841363c5 faster impl, removes all intermediate steps + cleanup 2022-03-10 14:21:39 +02:00
Tommi Reiman
1e5fb601da fix #538 2022-03-10 13:42:53 +02:00
Fredrik Vaeng Røtnes
7033abc530 Save three seq constructions 2022-03-05 01:46:03 +01:00
Tommi Reiman
382661a6c4 0.5.16 2022-02-15 16:55:08 +02:00
Tommi Reiman
0a872d8f3a 0.5.16-SNAPSHOT 2022-02-14 17:52:32 +02:00
Tommi Reiman
f3dee769fb format-ns 2022-02-14 16:59:20 +02:00
Tommi Reiman
2aba5610c7 format 2022-02-14 16:58:10 +02:00
Tommi Reiman
d0f7126491 add support for malli-lite 2022-02-14 16:45:14 +02:00
Tommi Reiman
bdcb1eb5b1 clean-ns 2022-02-12 22:35:27 +02:00
Tommi Reiman
5d4c886d35 format 2022-02-12 22:34:26 +02:00
Juho Teperi
07c39fc2df Setup clj-kondo files for each module
Clojure-lsp will run clj-kondo on the module folders, so those modules
should refer back to root configuration. Clj-kondo itself works the
same, if running from a module directory. Some editor plugins might run
clj-kondo on the working directory always (reitit root folder usually),
and in those cases this isn't needed.
2022-01-24 12:39:42 +02:00
Juho Teperi
ad90a2788e The goog-extend macro isn't used
Reitit.frontend.history was rewritten in 08156f6a6d
2021-12-22 21:49:02 +02:00
Juho Teperi
22461f638e
Merge pull request #507 from metosin/feature/improve-frontend-docs
Improve parameter names and docstrings on reitit frontend functions
2021-11-03 12:53:54 +02:00
Juho Teperi
9eded42ba1 Improve frontend docstrings 2021-11-03 12:53:27 +02:00
Juho Teperi
a7f3cd15ab
Merge pull request #481 from metosin/swagger-param-description-examples
Swagger param description examples
2021-11-03 12:22:51 +02:00
Juho Teperi
ac68f0f726 Improve parameter names and docstrings on reitit frontend functions 2021-09-07 14:38:42 +03:00
Tommi Reiman
8694d312f8 0.5.15 2021-08-05 18:46:29 +03:00
Tommi Reiman
db84daca95 0.5.14 2021-08-03 13:41:27 +03:00
Tommi Reiman
38f2bd4812
Merge branch 'master' into fix-resource-handler-url-decoding 2021-08-03 13:33:39 +03:00
Tommi Reiman
5486174722
Merge pull request #501 from metosin/malli-fix
Fix malli encoding & update deps
2021-08-03 13:29:53 +03:00
Tommi Reiman
20b7cabed7 Fix Malli encoding,, #498 2021-08-03 08:46:51 +03:00
Dieter Komendera
056c70d269 Enrich request for pedestal/routing-interceptor default-queue
This ensures requests handled by the default queue also have
access to the router per the injected :reitit.core/router key
on the request.
2021-06-24 14:07:23 +02:00
Miikka Koskinen
1297cfd902 Handle URL-encoded paths in file and resource handlers 2021-04-30 14:38:18 +03:00
Miikka Koskinen
51a26ed052 Release 0.5.13 2021-04-23 17:41:40 +03:00
Miikka Koskinen
1b583c1cc2 Remove operation-id uniqueness check
Let's leave that for other tools for now.
2021-04-23 17:02:17 +03:00
Juho Teperi
a3aa5df111 Fix exception log handler, *out* is not PrintWriter necessarily 2021-03-11 21:57:15 +02:00
Jonathon McKitrick
c033f10e4e
Update swagger_ui.cljc
Fix spelling in docstring.
2021-03-11 08:41:31 -05:00