Commit graph

226 commits

Author SHA1 Message Date
Graham Esau
1c47af475f 1.0.0-alpha.13 2024-08-27 19:27:42 +01:00
Graham Esau
d7ff81de96 Fix regex attribute when it uses dereferencing 2024-08-27 19:26:02 +01:00
Graham Esau
ae2b5f16c0 1.0.0-alpha.12 2024-08-27 19:04:48 +01:00
Maximilian Güntner
04fa0713da
fix: honor rename_all_fields, add tests (#304) 2024-08-27 17:55:21 +01:00
Graham Esau
d07a1be031
Rewrite attribute handling code (#330) 2024-08-27 16:50:47 +01:00
Graham Esau
66f17fff0e
Allow regex(path = ...) value to be a non-string expression (#328) 2024-08-24 18:27:27 +01:00
Graham Esau
26366d112d 1.0.0-alpha.11 2024-08-24 14:38:55 +01:00
Graham Esau
df06fc5f66
Allow arbitrary expressions in doc/title/description attributes (#327) 2024-08-24 14:35:30 +01:00
Graham Esau
016d20c1eb 1.0.0-alpha.10 2024-08-22 20:00:04 +01:00
Graham Esau
9683d18e67 1.0.0-alpha.9 2024-08-21 17:54:53 +01:00
Graham Esau
8438865588 Disable doctests for derive code snippets 2024-08-21 17:52:56 +01:00
Graham Esau
2914a1b66a Include derive(JsonSchema) docs in rustdoc 2024-08-21 17:52:56 +01:00
Graham Esau
f8974a951d 1.0.0-alpha.8 2024-08-21 16:20:01 +01:00
Graham Esau
b4f214f6dc
Remove usages of gen identifier (#323)
`gen` is a reserved keyword in rust 2024, making it very awkward to use as a module/variable name.
2024-08-21 16:15:13 +01:00
Graham Esau
8fa61b09a4 1.0.0-alpha.7 2024-08-19 22:33:56 +01:00
Graham Esau
85626ab3a3 Enable (and fix) more clippy lints 2024-08-19 10:42:05 +01:00
Graham Esau
677f76f7a3 1.0.0-alpha.6 2024-08-17 20:12:53 +01:00
Graham Esau
a6698f8955 Make custom CSS available in both crate directories
This *should* fix the docs.rs build...
2024-08-17 20:05:43 +01:00
Graham Esau
4b7e9ace01 1.0.0-alpha.5 2024-08-17 19:50:07 +01:00
Graham Esau
89a34e7a63
Add no_std support via disabling the new default feature std (#319) 2024-08-17 19:46:11 +01:00
Graham Esau
3c9e49d161 1.0.0-alpha.4 2024-08-17 16:20:51 +01:00
Bilal Mahmoud
0af8f50086
Add absolute import for Result (#307)
This changes it so that the `Result` used in the derived schema code is using the absolute path to the `Result` enum, otherwise type aliases, such as: `error_stack::Result` cannot be used.
2024-08-17 13:28:56 +01:00
Graham Esau
faf15e7859 Merge metadata setters and transform applications if they're both specified 2024-08-12 18:24:38 +01:00
Graham Esau
eb3077742f Optimise applying metadata
This reduces the output MIR size of the example code from https://github.com/GREsau/schemars/issues/246 by ~50% (from 18k to 9k lines)
2024-08-12 18:21:25 +01:00
Graham Esau
7bcd200a21 v1.0.0-alpha.3 2024-08-10 13:40:05 +01:00
Graham Esau
14b06e71ba
Add transform = ... attribute (#312)
This allows running arbitrary transforms on generated schemas when deriving `JsonSchema`
2024-08-10 09:56:52 +01:00
Graham Esau
ce15380863
Do not collapse newlines in doc comments (#310) 2024-08-04 16:43:22 +01:00
Graham Esau
3150f98fc8 v1.0.0-alpha.2 2024-06-05 21:15:16 +01:00
Graham Esau
840315b2dd
Add #[schemars(extend("key" = value))] attribute (#297) 2024-06-05 21:09:52 +01:00
Graham Esau
3ee7c7f5e5 v1.0.0-alpha.1 2024-05-27 11:14:43 +01:00
Graham Esau
760403e2f5 Update doc comments and make SchemaGenerator available from crate root 2024-05-27 11:09:15 +01:00
Graham Esau
f8b56cb455 Replace is_referenceable() with always_inline_schema() 2024-05-26 16:51:42 +01:00
Graham Esau
1aaa162e0b Make schema_name() return Cow<'static, str> instead of String 2024-05-26 15:20:56 +01:00
Graham Esau
1819dceb24 Merge branch 'master' into v1 2024-05-23 17:31:52 +01:00
Graham Esau
5e20a37a1a v0.8.21 2024-05-23 17:26:07 +01:00
Graham Esau
3aa0e7fa3c
Support JSON Schema draft 2020-12 and use it by default (#294) 2024-05-19 20:49:45 +01:00
Graham Esau
7ecaa7feab
Revert unintentional change in behaviour when combining default and required attributes (#293)
Never add a field with the `default` attribute to a schema's `required` properties
2024-05-18 22:37:40 +01:00
Graham Esau
c4d42ec11a Refactor flatten and move it to _private, remove TempFixupForTests, regenerate test schemas 2024-05-13 22:02:32 +01:00
Graham Esau
18300c67bb
Use const instead of single-valued enum (#291) 2024-05-13 21:30:51 +01:00
Graham Esau
3b3870ca82 Simplify flatten
No longer use it for internally-tagged enums. Instead, use a private helper that adds the tag property.
2024-05-13 10:52:42 +01:00
Graham Esau
342cd5fd09
Define Schema as a newtype around serde_json::Value (#289) 2024-05-12 19:23:54 +01:00
Graham Esau
8da70a4d45 v0.8.19 2024-05-06 18:13:54 +01:00
Graham Esau
1a40d1b06c Fix deriving JsonSchema on enum without variants
Fixes #287
2024-05-06 18:12:20 +01:00
Graham Esau
4b90b6f8c8 v0.8.18 2024-05-06 13:58:49 +01:00
Graham Esau
d04c17bda4
Simplify generated enum code (#286)
* simplify the code generated for unit enums
* simplify generated code for validating object properties
* optimize internal and externally tagged enums

---------

Co-authored-by: Robin Appelman <robin@icewind.nl>
2024-05-06 13:54:13 +01:00
Graham Esau
e5ef0f8d7b v0.8.17 2024-04-28 19:03:40 +01:00
Graham Esau
df00e2fd71 Add comment explaining why we double-parse an Expr 2024-04-28 18:59:42 +01:00
Graham Esau
9501fe319f Update to syn 2 and serde_derive_internals 0.29 2024-04-28 18:56:06 +01:00
Graham Esau
e04e3a3a81 v0.8.16 2023-11-11 20:35:26 +00:00
Graham Esau
ae9544aaf9 Put schema value into a variable before calling apply_metadata
This reduces size of MIR output, which should somewhat mitigate #246
2023-11-11 20:28:10 +00:00