34 Commits

Author SHA1 Message Date
Kévin Commaille
f05d0e03a1 api: Disallow #[serde(flatten)] for single-body-fields of requests and responses
`#[ruma_api(body)]` must be used instead.
2024-12-15 03:07:49 -05:00
Jonas Platte
4547da0b7b Fix CI by changing where deprecations are added and allowed 2024-09-07 14:31:24 +00:00
Jonas Platte
6a049c93a1 macros: Fix METADATA references in generated tests 2024-09-07 14:31:24 +00:00
Jonas Platte
83acca397b macros: Fix test cfg in macro output 2024-09-07 14:31:24 +00:00
Jonas Platte
0e8388abab macros: Add __internal_macro_expand feature for better RA macro expansion 2024-09-07 07:57:30 +00:00
Jonas Platte
de6b08a2b5 macros: Simplify internal derive macro input parsing 2024-09-07 07:57:30 +00:00
Kévin Commaille
968c52b117 api: Rename request macro attribute query_map to query_all
Remove its IntoIterator bound to allow to represent
the query fields as a single struct or enum.
2024-06-21 19:15:59 +02:00
Jonas Platte
3dac70ead9
Remove most unreachable visibility modifiers 2023-07-19 14:32:14 +02:00
Jonas Platte
53622f8ce0
macros: Upgrade syn to 2.0 2023-04-24 17:02:23 +02:00
HKalbasi
ca99c97a0c
Use #[deprecated] instead of doc comments 2023-02-12 19:18:06 +01:00
Jonas Platte
3211fccab0
Remove borrowing in requests 2022-11-28 14:02:35 +01:00
Jonas Platte
7d018897b0
macros: Move ensure_feature_presence check from ruma_api to request / response 2022-11-10 11:33:18 +01:00
Jonas Platte
2451f33a64
api: Replace ruma_api! compile-time path check with a test 2022-11-10 11:33:17 +01:00
Jonas Platte
b7c47c9e70
macros: Always implement IncomingRequest trait on IncomingRequest type
… rather than the `Request` type, even if `IncomingRequest` is a type
alias for it.

This (only) affects where the implementation is shown in the
documentation.
2022-10-31 09:58:36 +01:00
Jonas Platte
f22857e682
macros: Add request attribute macro 2022-10-24 15:28:50 +02:00
Jonas Platte
c021a14b60
macros: Rename error_ty => error 2022-10-24 15:28:50 +02:00
Jonas Platte
1be2def65a
Revert "api: Remove error_ty from Request and Response derive attributes"
This reverts commit 1989e0350d61ca769b258ce5f2f48360dc4b3f3c.
2022-10-24 15:28:50 +02:00
Jonas Platte
dff84efb0c
api: Remove authentication from Request derive attributes 2022-10-22 12:25:27 +02:00
Jonas Platte
1989e0350d
api: Remove error_ty from Request and Response derive attributes 2022-10-22 12:24:22 +02:00
Jonas Platte
e7e39a6af1
api: Remove method from Request derive attributes 2022-10-22 12:24:21 +02:00
Jonas Platte
764e96a254
api: Enforce consistent path field order 2022-10-20 20:51:09 +02:00
Jonas Platte
a59a648d04
macros: Refactor RequestField 2022-09-26 15:48:45 +02:00
Jonas Platte
c745d3baf7
Fix clippy lint 2022-09-02 14:07:28 +02:00
Marcel Hellwig
92f862e279
macros: Generate certain structs only with client or server feature enabled
If neither the client, nor the server feature is enabled the fields are
unused and therefore trigger the dead_code lint.
2022-06-22 14:15:37 +02:00
Jonas Platte
73c2963ebd
Enforce consistent semicolons after ()-typed expressions in blocks 2022-06-03 08:40:16 +02:00
Jonas Platte
5f902851af
Upgrade to Rust 2021 2022-05-27 12:04:23 +02:00
Kévin Commaille
734770d2bc
macros: Refactor ruma_api attributes parsing 2022-05-23 21:51:47 +02:00
Jonas Platte
05ad164d21
macros: Fix errors from unused serde attributes with only server feature active 2022-03-25 12:26:52 +01:00
Jonas Platte
7a5be040fd
macros: Reduce codegen by feature-gating Serialize and Deserialize derives
… this makes it faster to compiler ruma-*-api with either the client or
server feature inactive.
2022-03-24 18:08:21 +01:00
Jonas Platte
a6a530dcc8 serde: Rename derive macro Outgoing to Incoming
All it does now is generate `Incoming{Self}` types.
2022-03-22 13:19:03 +01:00
Jonas Platte
e3a8b6b81f macros: Don't generate unused Outgoing structs
They are only needed when the server feature is active.
2022-03-22 13:19:03 +01:00
Kévin Commaille
bdcf07be87
common: Merge ruma-serde into ruma-common 2022-03-10 12:11:00 +01:00
Kévin Commaille
bdd54d1dd3
macros: Use import_ruma_common instead of import_ruma_api 2022-03-10 11:00:27 +01:00
Kévin Commaille
0d49715f29
macros: Merge ruma-api-macros into ruma-macros 2022-03-02 15:19:16 +01:00