You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Read #[validate(...)] attributes
* Handle required flattened Option fields
* Refactor out `add_schema_as_property`
* Process validation attributes in newtype structs
* Process validation attributes in tuple structs
* Refactor out "local_id" for type definitions
* Refactoring
* Support inline regex
* Allow setting validation attributes via #[schemars(...)]
* Add some doc comments
* Fix doc test
* Emit compilation errors for duplicate validation attributes
* Fix indexmap tests for rust 1.37
* upgrade diem dep (#1)
* Update changelog and docs
* Add newline to attributes docs
* v0.8.4
* Allow empty #[validate] attributes.
FixesGREsau#109
* v0.8.5
* Use oneOf for enums when possible (GREsau#108)
* v0.8.6
* Correct latest changelog entry
* update diem dep
* Implement JsonSchema on EnumSet type
* update diem dep
* Upgrade move deps (#3)
* [deps] Upgrade move types dep.
* Update examples after 0a1200b
* Allow non-Serialize default values.
Default values that don't implement Serialize are now ignored, rather than causing a compile error.
This is done by simulating specialization using a technique copied from Rocket:
https://github.com/SergioBenitez/Rocket/blob/5ebefa97c992c37bdc476299304a339d429a43fc/core/lib/src/sentinel.rs#L391-L445FixesGREsau#115
* v0.8.7
* update diem deps
* Add example for optional dependency in readme
Based on https://github.com/GREsau/schemars/pull/118/files
* Add support for rust_decimal and bigdecimal (GREsau#101)
* Document new optional dependencies
* Internally tagged enums don't honor deny_unknown_fields as precisely as
they might.
flatten doesn't act quite as intended with regard to
additional_properties
* v0.8.8
* update diem deps to latest
* update diem deps
* Update dep
* update diem deps
* Update rust toolchain and dep
* update diem dep
* Update diem dep
* [crypto] Update dependency crypto to use starcoinorg/starcoin-crypto repo (#5)
* [crypto] Update dependency crypto to use starcoinorg/starcoin-crypto repo.
* [deps] Update move-core-types to starcoinorg/move
* Remove diem types
Co-authored-by: Graham Esau <[email protected]>
Co-authored-by: lerencao <[email protected]>
Co-authored-by: Graham Esau <[email protected]>
Co-authored-by: Adam Leventhal <[email protected]>
Co-authored-by: Matt Campbell <[email protected]>
Co-authored-by: jolestar <[email protected]>
Co-authored-by: timando <[email protected]>
Co-authored-by: Adam H. Leventhal <[email protected]>
Copy file name to clipboardexpand all lines: CHANGELOG.md
+24-1
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,31 @@
1
1
# Changelog
2
2
3
-
## [0.8.4] - **In-dev**
3
+
## [0.8.8] - 2021-11-25
4
+
### Added:
5
+
- Implement `JsonSchema` for types from `rust_decimal` and `bigdecimal` crates (https://github.com/GREsau/schemars/pull/101)
6
+
7
+
### Fixed:
8
+
- Fixes for internally tagged enums and flattening additional_properties (https://github.com/GREsau/schemars/pull/113)
9
+
10
+
## [0.8.7] - 2021-11-14
11
+
### Added:
12
+
- Implement `JsonSchema` for `EnumSet` (https://github.com/GREsau/schemars/pull/92)
13
+
14
+
### Fixed:
15
+
- Do not cause compile error when using a default value that doesn't implement `Serialize` (https://github.com/GREsau/schemars/issues/115)
16
+
17
+
## [0.8.6] - 2021-09-26
18
+
### Changed:
19
+
- Use `oneOf` instead of `anyOf` for enums when possible (https://github.com/GREsau/schemars/issues/108)
20
+
21
+
## [0.8.5] - 2021-09-20
22
+
### Fixed:
23
+
- Allow fields with plain `#[validate]` attributes (https://github.com/GREsau/schemars/issues/109)
24
+
25
+
## [0.8.4] - 2021-09-19
4
26
### Added:
5
27
-`#[schemars(schema_with = "...")]` attribute can now be set on enum variants.
28
+
- Deriving JsonSchema will now take into account `#[validate(...)]` attributes, compatible with the [validator](https://github.com/Keats/validator) crate (https://github.com/GREsau/schemars/pull/78)
Copy file name to clipboardexpand all lines: docs/1.1-attributes.md
+77-1
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,9 @@ h3 code {
16
16
17
17
You can add attributes to your types to customize Schemars's derived `JsonSchema` implementation.
18
18
19
-
Serde also allows setting `#[serde(...)]` attributes which change how types are serialized, and Schemars will generally respect these attributes to ensure that generated schemas will match how the type is serialized by serde_json. `#[serde(...)]` attributes can be overriden using `#[schemars(...)]` attributes, which behave identically (e.g. `#[schemars(rename_all = "camelCase")]`). You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde.
19
+
[Serde](https://serde.rs/) allows setting `#[serde(...)]` attributes which change how types are serialized, and Schemars will generally respect these attributes to ensure that generated schemas will match how the type is serialized by serde_json. `#[serde(...)]` attributes can be overriden using `#[schemars(...)]` attributes, which behave identically (e.g. `#[schemars(rename_all = "camelCase")]`). You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde.
20
+
21
+
[Validator](https://github.com/Keats/validator) allows setting `#[validate(...)]` attributes to restrict valid values of particular fields, many of which will be used by Schemars to generate more accurate schemas. These can also be overridden by `#[schemars(...)]` attributes.
Sets the `pattern` property for string schemas. The `path::to::regex` will typically refer to a [`Regex`](https://docs.rs/regex/*/regex/struct.Regex.html) instance, but Schemars allows it to be any value with a `to_string()` method.
206
+
207
+
Providing an inline regex pattern using `regex(pattern = ...)` is a Schemars extension, and not currently supported by the Validator crate. When using this form, you may want to use a `r"raw string literal"` so that `\\` characters in the regex pattern are not interpreted as escape sequences in the string.
For string schemas, sets the `pattern` property to the given value, with any regex special characters escaped. For object schemas (e.g. when the attribute is set on a HashMap field), includes the value in the `required` property, indicating that the map must contain it as a key.
0 commit comments