Commit graph

447 commits

Author SHA1 Message Date
Juho Teperi
0a7b50a730 Test fix, silence extra cljs warnings 2025-01-22 12:09:14 +02:00
Juho Teperi
0370750a3f Run some ring tests only on jvm 2025-01-22 11:56:35 +02:00
Tommi Reiman
1abff4937c
Update exception_test.clj
ring.util.http-response should be enough
2024-12-08 14:54:14 +02:00
Eugene Pakhomov
cc1cd114e4 Make exception middleware return proper Ring responses 2024-12-07 23:47:05 +02:00
Markus Penttilä
702e7b8972 Add OpenAPI :requestBody for :form request schema
OpenAPI Specification 3 requires defining form parameters, i.e. classic
application/x-www-form-urlencoded type body as a :requestBody. They are
not supported as regular parameters like in OAS 2.
2024-10-09 22:28:57 -04:00
Dekel Pilli
f1ec7bbe8e
fix: fix bug where http ring handler would cause :path to be applied twice 2024-09-02 15:40:00 +10:00
Ben Sless
78cc54d3a8 Add generative test for new keywordize 2024-08-26 17:07:51 +03:00
Tommi Reiman
49e8d887da fixes #679 2024-06-30 17:55:47 +03:00
Tommi Reiman
129de37d3e . 2024-06-29 16:23:35 +03:00
Tommi Reiman
77f0798c06 . 2024-06-29 16:22:31 +03:00
Tommi Reiman
eb4c231c23 format 2024-06-29 16:21:35 +03:00
Tommi Reiman
2da94f733d don't merge records 2024-06-29 16:21:28 +03:00
Tommi Reiman
d136975154 format 2024-06-29 16:20:44 +03:00
Peter Strömberg
2f3fc21c84 Add arities 1 and 2 to rf/match->path
To adhere to the docstring's info about parameter 2 and 3 being optional
2024-06-21 09:59:33 +02:00
Joel Kaasinen
275b789ca9
Merge pull request #677 from metosin/improve-swagger-var-tests
test: add response schema to reitit.swagger-test/malli-var-test
2024-04-26 08:59:23 +03:00
Joel Kaasinen
18550cd297 test: add response schema to reitit.swagger-test/malli-var-test 2024-04-22 09:08:37 +03:00
Joel Kaasinen
3296323059 test: use string refs in openapi-malli-tests
... in order to pass the validator, which disallows "/"
2024-04-22 08:31:51 +03:00
Joel Kaasinen
037763561e fix: location of openapi :requestBody :description
:description should be under :requestBody, not under :content. Thanks
to openapi-schema-validator for noticing this.

Also fix examples in openapi-malli-tests to make the resulting schema
valid.
2024-04-22 08:31:51 +03:00
Joel Kaasinen
57fc00a45e test: tests for openapi + malli refs/vars 2024-04-22 08:00:27 +03:00
Joel Kaasinen
ce52b26329 test: actually assert something in openapi-malli-tests
(is (= x) y) strikes again
2024-04-22 08:00:27 +03:00
Joel Kaasinen
288b701d4e feat: openapi #/components/schemas
collect definitions when traversing the models, and put them in the
right place for openapi

depends on :malli.json-schema/definitions-path support
2024-04-22 08:00:27 +03:00
Joel Kaasinen
c2372473d0 test: test for malli vars + swagger 2024-04-22 08:00:27 +03:00
Joel Kaasinen
c67a748915
Merge pull request #585 from djblue/var-handler
Allow var handlers
2024-03-15 10:35:22 +02:00
Joel Kaasinen
5d30a73bad feat: reitit.core/Expand for Vars 2024-03-15 09:21:51 +02:00
Joel Kaasinen
659e96e780 test: handler can be a var 2024-03-15 09:18:54 +02:00
Martín Varela
ed280f9a33 feature: fetch openapi content types from muuntaja
(level 1 integration in #636)
2024-02-09 11:49:44 +02:00
Martín Varela
982ac3ec72 Fix: account for changed malli encoder behavior that was breaking ring-coercion-test 2024-02-09 11:37:34 +02:00
Martín Varela
f99a76886e Fix: fix swagger ring tests, malli keys are now strings, not keywords 2024-02-09 11:21:31 +02:00
Joel Kaasinen
b4c0936207 Merge remote-tracking branch 'origin/master' into fix-openapi-examples 2023-09-11 07:53:15 +03:00
Joel Kaasinen
7352358662 feat: rename openapi :content-types keyword, split for req & resp 2023-09-08 15:17:35 +03:00
Joel Kaasinen
f1d26791fc Merge branch 'master' into rework-pr-589 2023-08-30 08:29:06 +03:00
Joel Kaasinen
d5021e549a fix: pick up openapi examples from [:responses _ :content :default] 2023-08-28 13:48:23 +03:00
Joel Kaasinen
4d1d469686 test: test multiple examples using new syntax 2023-08-28 13:48:23 +03:00
Joel Kaasinen
6f111bce2e refactor: share -get-apidocs-openapi between malli, spec & schema 2023-08-28 09:24:10 +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
0728154751 name the doseq-tests 2023-05-29 12:07:54 +03:00
Tommi Reiman
b1404ada6d top-level :request coercion & stuff 2023-05-28 16:49:08 +03:00
Tommi Reiman
1b5287724e format 2023-05-27 19:02:10 +03:00
Tommi Reiman
d17c97780e wrap :content schemas in :schema 2023-05-27 19:01:17 +03:00
Tommi Reiman
9f58bb22e3 kill ctrl 2023-05-22 20:28:20 +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
Joel Kaasinen
1983a4bb64 test: openapi parameter descriptions via schema 2023-05-17 16:06:45 +03:00
Joel Kaasinen
c443adbfca test: openapi parameter descriptions via spec 2023-05-17 08:25:44 +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
Joel Kaasinen
2e8e9265d9 test: document current openapi3 description behaviour
malli works weirdly, others don't
2023-05-17 08:19:26 +03:00