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
599fbb38b6
Fix JsonSchema
impls for atomics
...
This was broken in 1c34428394
2024-08-16 22:27:45 +01:00
Graham Esau
1c34428394
Remove build.rs, use target_has_atomic
instead
...
`target_has_atomic` has been stable since rust 1.60
2024-08-14 12:00:25 +01:00
Graham Esau
1701acbc17
Add link to migration guide
2024-08-13 20:59:18 +01:00
Graham Esau
705aba1cef
Fix flattening of serde_json::Value
...
It should behave similarly to flattening a `Map<String,Value>` in that it allows any properties
2024-08-13 20:19:22 +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
9921d2859f
Fix (most) rustdoc warnings
2024-08-11 17:14:36 +01:00
Graham Esau
34914a6c50
Merge pull request #290 from GREsau/v1
...
Changes for v1.0.0 (still in-progress)
2024-08-10 18:00:46 +01:00
Graham Esau
5054242247
Merge branch 'master' into v1
2024-08-10 17:58:35 +01:00
Graham Esau
4609590e8e
Update changelog for 1.0.0 alpha versions
2024-08-10 17:57:18 +01:00
Graham Esau
c61b26091e
Update examples
2024-08-10 17:57:02 +01:00
Graham Esau
7bcd200a21
v1.0.0-alpha.3
2024-08-10 13:40:05 +01:00
Graham Esau
56ebd54c6c
Add v0/v1 note to readme
2024-08-10 13:38:48 +01:00
Graham Esau
55b88b53db
Add migration guide
2024-08-10 13:01:36 +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
29067a0331
Add GenTransform::as_any_mut
and add examples
2024-08-09 11:03:12 +01:00
Graham Esau
a1c3bcd5cf
Add Send
requirement to GenTransform
...
This means `SchemaSettings` and `SchemaGenerator` are both now `Send`
2024-08-08 22:07:02 +01:00
Graham Esau
324be32de6
Replace visit::Visitor
with transform::Transform
2024-08-07 19:20:01 +01:00
Graham Esau
71b45a8ba3
Remove irrelevant comments
...
I'm reasonably satisfied that the current behaviour of enum variants with `with`/`schema_with` attributes is correct
2024-08-04 17:26:08 +01:00
Graham Esau
ef9c8dc56b
Fix doctest
2024-08-04 16:59:10 +01:00
Graham Esau
ade95a54d5
Remove default implementation of Visitor::visit_schema()
...
Since it's now the only method, there's no good reason to implement the trait without implementing that method.
2024-08-04 16:45:39 +01:00
Graham Esau
ce15380863
Do not collapse newlines in doc comments ( #310 )
2024-08-04 16:43:22 +01:00
Graham Esau
91ee3f915c
Update docs for v1
2024-06-09 19:48:35 +01:00
Graham Esau
692958353d
Add extend
attribute to docs
2024-06-09 19:26:40 +01:00
Graham Esau
d511d447f7
Add separate docs for v0.8/v1
2024-06-09 19:01:24 +01:00
Graham Esau
e0c2c31dc9
Update changelog for 1.0.0-alpha.2
2024-06-05 21:22:25 +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
3271fbd96a
Update changelog for 1.0.0-alpha.1
2024-05-27 15:16:20 +01:00
Graham Esau
a20c197b99
Update readme - link to v1 branch/PR
2024-05-27 14:31:03 +01:00
Graham Esau
97b70aa82c
Update readme for v1
2024-05-27 14:25:45 +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
fb6e1a5c61
Regenerate example schemas
2024-05-26 21:22:48 +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
fe05631f21
impl JsonSchema for Schema
2024-05-23 17:44:50 +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
a9a9c7e8ed
Fix "null" default not being set on schema ( #296 )
...
Fixes #295
2024-05-23 17:25:07 +01:00
Graham Esau
1247b8975e
Revert to previous behaviour regarding visitors running on $defs
/definitions
lazily (only if/when root schema is created).
...
Visitors will now always descend into `$defs`/`definitions`. If a generator is configured to use a different definitions path, then the visitor will also descend into that path (but a plain `Visitor` would NOT.
2024-05-23 14:14:42 +01:00
Graham Esau
d32231c082
Allow running visitors against pre-2020-12 schemas
2024-05-20 15:25:16 +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
95475ad1b4
Use $defs
instead of definitions
in draft 2019-09
...
This also changes the strategy for running visitors on subschemas - it is now done eagerly, as soon as they're added to the definitions map.
2024-05-19 18:07:51 +01:00
Graham Esau
22e89a5dd6
Never add a field with the default
attribute to a schema's required
properties
2024-05-18 23:00:24 +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