Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uuid v1 and arrayvec 0.7 #142

Merged
merged 6 commits into from
May 16, 2022
Merged

Support uuid v1 and arrayvec 0.7 #142

merged 6 commits into from
May 16, 2022

Conversation

GREsau
Copy link
Owner

@GREsau GREsau commented May 15, 2022

Supersedes #138

Support for the new versions of these crates is added in a backward-compatible way - the arrayvec and uuid features will still implement JsonSchema for types in previous versions of those crates.

The new crate versions can be used by enabling the uuid1 and arrayvec07 features. When I next make breaking changes to schemars, I'll probably change the uuid feature to behave the same as uuid1, since it's highly unlikely there will be a v2 of uuid according to its release notes. I will probably just remove the arrayvec feature, unless its maintainers announce they don't expect breaking changes.

This PR does not add any support for arrayvec 0.6, since no-one has asked for it as far as I know.

This change also updates dev dependencies and serde_derive_internals.

It's probably worth taking a look at the other optional dependencies, judging whether they're likely to have breaking changes in future, and if so, add version suffixes to their corresponding feature flags.

Documentation (including readme) still needs updating before merging!

Copy link

@jhpratt jhpratt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff LGTM

Copy link
Contributor

@ahl ahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this; do you think this warrants an update to the README to explain the situation?

schemars/Cargo.toml Outdated Show resolved Hide resolved
GREsau and others added 2 commits May 16, 2022 22:02
Co-authored-by: Adam Leventhal <ahl@oxide.computer>
@GREsau
Copy link
Owner Author

GREsau commented May 16, 2022

do you think this warrants an update to the README to explain the situation?

I've documented the new flags in the README, and mentioned the deprecation of previous feature flags in the changelog, which hopefully is enough for now

@GREsau GREsau merged commit 74974d3 into master May 16, 2022
@GREsau GREsau deleted the bump-dependencies branch May 16, 2022 21:42
@GREsau
Copy link
Owner Author

GREsau commented May 16, 2022

Published to crates.io in schemars 0.8.9 🎉

@ahl
Copy link
Contributor

ahl commented May 19, 2022

This ship may have sailed, but would it work to simply change the dependency on uuid:

@@ -21,7 +21,7 @@ dyn-clone = "1.0"
 chrono = { version = "0.4", default-features = false, optional = true }
 indexmap = { version = "1.2", features=["serde-1"], optional = true }
 either = { version = "1.3", default-features = false, optional = true }
-uuid = { version = "0.8", default-features = false, optional = true }
+uuid = { version = ">=0.8.0, <2.0.0", default-features = false, optional = true }
 smallvec = { version = "1.0", optional = true }
 arrayvec = { version = "0.5", default-features = false, optional = true }
 url = { version = "2.0", default-features = false, optional = true }

I'm pretty sure that the use of uuid is compatible across those versions (and probably even farther back than 0.8)

This would make things much simpler for consumers of schemars

bors bot referenced this pull request in stackabletech/operator-rs Jun 3, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [clap](https://togithub.com/clap-rs/clap) | dependencies | patch | `3.1.12` -> `3.1.18` |
| [const_format](https://togithub.com/rodrimati1992/const_format_crates) | dependencies | patch | `0.2.22` -> `0.2.24` |
| [proc-macro2](https://togithub.com/dtolnay/proc-macro2) | dependencies | patch | `1.0.37` -> `1.0.39` |
| [quote](https://togithub.com/dtolnay/quote) | dependencies | patch | `1.0.17` -> `1.0.18` |
| [regex](https://togithub.com/rust-lang/regex) | dependencies | patch | `1.5.5` -> `1.5.6` |
| [schemars](https://graham.cool/schemars/) ([source](https://togithub.com/GREsau/schemars)) | dependencies | patch | `=0.8.8` -> `=0.8.10` |
| [serde](https://serde.rs) ([source](https://togithub.com/serde-rs/serde)) | dependencies | patch | `1.0.136` -> `1.0.137` |
| [serde_json](https://togithub.com/serde-rs/json) | dependencies | patch | `1.0.79` -> `1.0.81` |
| [serde_yaml](https://togithub.com/dtolnay/serde-yaml) | dependencies | patch | `0.8.23` -> `0.8.24` |
| [syn](https://togithub.com/dtolnay/syn) | dependencies | patch | `1.0.91` -> `1.0.96` |
| [thiserror](https://togithub.com/dtolnay/thiserror) | dependencies | patch | `1.0.30` -> `1.0.31` |
| [tokio](https://tokio.rs) ([source](https://togithub.com/tokio-rs/tokio)) | dependencies | patch | `1.18.0` -> `1.18.2` |

---

### Release Notes

<details>
<summary>clap-rs/clap</summary>

### [`v3.1.18`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#&#8203;3118---2022-05-10)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v3.1.17...v3.1.18)

##### Fixes

-   Fix deprecated `arg_enum!` for users migrating to clap3 ([#&#8203;3717](https://togithub.com/clap-rs/clap/issues/3717))
-   Verify all `required_unless_present_all` arguments exist
-   Verify group members exist before processing group members ([#&#8203;3711](https://togithub.com/clap-rs/clap/issues/3711))
-   *(help)* Use `...` when not enough `value_names` are supplied

**gated behind `unstable-v4`**

-   Verify `required` is not used with conditional required settings ([#&#8203;3660](https://togithub.com/clap-rs/clap/issues/3660))
-   Disallow more `value_names` than `number_of_values` ([#&#8203;2695](https://togithub.com/clap-rs/clap/issues/2695))
-   *(parser)* Assert on unknown args when using external subcommands ([#&#8203;3703](https://togithub.com/clap-rs/clap/issues/3703))
-   *(parser)* Always fill in `""` argument for external subcommands ([#&#8203;3263](https://togithub.com/clap-rs/clap/issues/3263))
-   *(derive)* Detect escaped external subcommands that look like built-in subcommands ([#&#8203;3703](https://togithub.com/clap-rs/clap/issues/3703))
-   *(derive)* Leave `Arg::id` as `verbatim` casing ([#&#8203;3282](https://togithub.com/clap-rs/clap/issues/3282))

### [`v3.1.17`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#&#8203;3117---2022-05-06)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v3.1.16...v3.1.17)

##### Fixes

-   Allow value names for `arg!` macro to have dashes when quoted, like longs

### [`v3.1.16`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#&#8203;3116---2022-05-06)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v3.1.15...v3.1.16)

##### Fixes

-   *(parser)* `Arg::exclusive` overrides `Arg::required`, like other conflicts
-   *(error)* Don't duplicate arguments in usage
-   *(error)* Don't show hidden arguments in conflict error usage
-   *(help)* New `help_template` variable `{name}` to fix problems with `{bin}`
-   *(help)* Don't wrap URLs

**gated behind `unstable-v4`**

-   Leading dashes in `Arg::long` are no longer allowed
-   *(help)* Use `Command::display_name` in the help title rather than `Command::bin_name`

### [`v3.1.15`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#&#8203;3115---2022-05-02)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v3.1.14...v3.1.15)

##### Fixes

-   *(error)* Render actual usage for unrecognized subcommands
-   *(multicall)* Improve bad command error
-   *(multicall)* Always require a multicall command
-   *(multicall)* Disallow arguments on multicall parent command
-   *(multicall)* More consistent with rest of clap errors

### [`v3.1.14`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#&#8203;3114---2022-05-01)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v3.1.13...v3.1.14)

##### Fixes

-   Panic when calling `Command::build` with a required positional argument nested several layers in subcommands

### [`v3.1.13`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#&#8203;3113---2022-04-30)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v3.1.12...v3.1.13)

##### Fixes

-   Help subcommand and `Command::write_help` now report required arguments in usage in more circumstances
-   Unknown subcommand for help subcommand flag now reports an error with more context
-   More details reported when using `debug` feature
-   Allow disabling `color` feature with `debug` feature enabled

</details>

<details>
<summary>rodrimati1992/const_format_crates</summary>

### [`v0.2.23`](https://togithub.com/rodrimati1992/const_format_crates/blob/HEAD/Changelog.md#&#8203;0223)

Added type annotations to `concatp`, `concatcp`, `formatc` and `formatcp` macros to help IDEs infer the type.

</details>

<details>
<summary>dtolnay/proc-macro2</summary>

### [`v1.0.39`](https://togithub.com/dtolnay/proc-macro2/releases/tag/1.0.39)

[Compare Source](https://togithub.com/dtolnay/proc-macro2/compare/1.0.38...1.0.39)

-   Replace unicode-xid with unicode-ident crate: https://github.com/dtolnay/unicode-ident

### [`v1.0.38`](https://togithub.com/dtolnay/proc-macro2/releases/tag/1.0.38)

[Compare Source](https://togithub.com/dtolnay/proc-macro2/compare/1.0.37...1.0.38)

-   Reduce allocations done by `Literal::byte_string` constructor ([#&#8203;328](https://togithub.com/dtolnay/proc-macro2/issues/328))

</details>

<details>
<summary>dtolnay/quote</summary>

### [`v1.0.18`](https://togithub.com/dtolnay/quote/compare/1.0.17...1.0.18)

[Compare Source](https://togithub.com/dtolnay/quote/compare/1.0.17...1.0.18)

</details>

<details>
<summary>rust-lang/regex</summary>

### [`v1.5.6`](https://togithub.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#&#8203;156-2022-05-20)

[Compare Source](https://togithub.com/rust-lang/regex/compare/1.5.5...1.5.6)

\==================
This release includes a few bug fixes, including a bug that produced incorrect
matches when a non-greedy `?` operator was used.

-   [BUG #&#8203;680](https://togithub.com/rust-lang/regex/issues/680):
    Fixes a bug where `[[:alnum:][:^ascii:]]` dropped `[:alnum:]` from the class.
-   [BUG #&#8203;859](https://togithub.com/rust-lang/regex/issues/859):
    Fixes a bug where `Hir::is_match_empty` returned `false` for `\b`.
-   [BUG #&#8203;862](https://togithub.com/rust-lang/regex/issues/862):
    Fixes a bug where 'ab??' matches 'ab' instead of 'a' in 'ab'.

</details>

<details>
<summary>GREsau/schemars</summary>

### [`v0.8.10`](https://togithub.com/GREsau/schemars/blob/HEAD/CHANGELOG.md#&#8203;0810---2022-05-17)

[Compare Source](https://togithub.com/GREsau/schemars/compare/v0.8.9...v0.8.10)

-   Undo "Support generic default values in default attributes ([https://github.com/GREsau/schemars/pull/83](https://togithub.com/GREsau/schemars/pull/83))" as it inadvertently introduced a breaking change ([https://github.com/GREsau/schemars/issues/144](https://togithub.com/GREsau/schemars/issues/144))

### [`v0.8.9`](https://togithub.com/GREsau/schemars/blob/HEAD/CHANGELOG.md#&#8203;089---2022-05-16)

[Compare Source](https://togithub.com/GREsau/schemars/compare/v0.8.8...v0.8.9)

##### Added:

-   \~~Support generic default values in `default` attributes ([https://github.com/GREsau/schemars/pull/83](https://togithub.com/GREsau/schemars/pull/83))~~
    -   ⚠️ **This inadvertently introduced a breaking change and was removed in 0.8.10**
-   Add missing MIT licence text for usage of code from regex_syntax crate ([https://github.com/GREsau/schemars/pull/132](https://togithub.com/GREsau/schemars/pull/132))
-   Support uuid v1 and arrayvec 0.7 via feature flags `uuid1` and `arrayvec07` ([https://github.com/GREsau/schemars/pull/142](https://togithub.com/GREsau/schemars/pull/142))
    -   This also adds `uuid08` and `arrayvec05` feature flags for the previously supported versions of these crates. The existing `uuid` and `arrayvec` flags are still supported for backward-compatibility, but they are **deprecated**.
    -   Similarly, `indexmap1` feature flag is added, and `indexmap` flag is **deprecated**.

</details>

<details>
<summary>serde-rs/serde</summary>

### [`v1.0.137`](https://togithub.com/serde-rs/serde/releases/tag/v1.0.137)

[Compare Source](https://togithub.com/serde-rs/serde/compare/v1.0.136...v1.0.137)

-   Update documentation links to some data formats whose repos have moved ([#&#8203;2201](https://togithub.com/serde-rs/serde/issues/2201), thanks [@&#8203;atouchet](https://togithub.com/atouchet))
-   Fix declared `rust-version` of serde and serde_test ([#&#8203;2168](https://togithub.com/serde-rs/serde/issues/2168))

</details>

<details>
<summary>serde-rs/json</summary>

### [`v1.0.81`](https://togithub.com/serde-rs/json/releases/tag/v1.0.81)

[Compare Source](https://togithub.com/serde-rs/json/compare/v1.0.80...v1.0.81)

-   Work around `indexmap`/`autocfg` not always properly detecting whether a `std` sysroot crate is available ([#&#8203;885](https://togithub.com/serde-rs/json/issues/885), thanks [@&#8203;cuviper](https://togithub.com/cuviper))

### [`v1.0.80`](https://togithub.com/serde-rs/json/releases/tag/v1.0.80)

[Compare Source](https://togithub.com/serde-rs/json/compare/v1.0.79...v1.0.80)

-   Documentation improvements

</details>

<details>
<summary>dtolnay/serde-yaml</summary>

### [`v0.8.24`](https://togithub.com/dtolnay/serde-yaml/releases/tag/0.8.24)

[Compare Source](https://togithub.com/dtolnay/serde-yaml/compare/0.8.23...0.8.24)

-   Work around `indexmap`/`autocfg` not always properly detecting whether a `std` sysroot crate is available ([#&#8203;243](https://togithub.com/dtolnay/serde-yaml/issues/243), thanks [@&#8203;cuviper](https://togithub.com/cuviper))

</details>

<details>
<summary>dtolnay/syn</summary>

### [`v1.0.96`](https://togithub.com/dtolnay/syn/releases/tag/1.0.96)

[Compare Source](https://togithub.com/dtolnay/syn/compare/1.0.95...1.0.96)

-   Add a `punct_mut()` method on `syn::punctuated::Pair` to return `Option<&mut P>` ([#&#8203;1183](https://togithub.com/dtolnay/syn/issues/1183))

### [`v1.0.95`](https://togithub.com/dtolnay/syn/releases/tag/1.0.95)

[Compare Source](https://togithub.com/dtolnay/syn/compare/1.0.94...1.0.95)

-   Replace unicode-xid with unicode-ident crate: https://github.com/dtolnay/unicode-ident

### [`v1.0.94`](https://togithub.com/dtolnay/syn/releases/tag/1.0.94)

[Compare Source](https://togithub.com/dtolnay/syn/compare/1.0.93...1.0.94)

-   Resolve some unused_macro_rules warnings

### [`v1.0.93`](https://togithub.com/dtolnay/syn/releases/tag/1.0.93)

[Compare Source](https://togithub.com/dtolnay/syn/compare/1.0.92...1.0.93)

-   Fix compile error when `Some` means something unusual in the expression namespace of the scope where `custom_keyword` is invoked ([#&#8203;1171](https://togithub.com/dtolnay/syn/issues/1171), thanks [@&#8203;zakarumych](https://togithub.com/zakarumych))

### [`v1.0.92`](https://togithub.com/dtolnay/syn/releases/tag/1.0.92)

[Compare Source](https://togithub.com/dtolnay/syn/compare/1.0.91...1.0.92)

-   Make compatible with Miri's tag-raw-pointers mode ([#&#8203;1166](https://togithub.com/dtolnay/syn/issues/1166), thanks [@&#8203;saethlin](https://togithub.com/saethlin))

</details>

<details>
<summary>dtolnay/thiserror</summary>

### [`v1.0.31`](https://togithub.com/dtolnay/thiserror/releases/tag/1.0.31)

[Compare Source](https://togithub.com/dtolnay/thiserror/compare/1.0.30...1.0.31)

-   Improve diagnostic when there is an enum variant containing `#[from] #[backtrace] Error, Backtrace` ([#&#8203;163](https://togithub.com/dtolnay/thiserror/issues/163))

</details>

<details>
<summary>tokio-rs/tokio</summary>

### [`v1.18.2`](https://togithub.com/tokio-rs/tokio/releases/tag/tokio-1.18.2)

[Compare Source](https://togithub.com/tokio-rs/tokio/compare/tokio-1.18.1...tokio-1.18.2)

##### 1.18.2 (May 5, 2022)

Add missing features for the `winapi` dependency. ([#&#8203;4663])

[#&#8203;4663]: https://togithub.com/tokio-rs/tokio/pull/4663

### [`v1.18.1`](https://togithub.com/tokio-rs/tokio/releases/tag/tokio-1.18.1)

[Compare Source](https://togithub.com/tokio-rs/tokio/compare/tokio-1.18.0...tokio-1.18.1)

##### 1.18.1 (May 2, 2022)

The 1.18.0 release broke the build for targets without 64-bit atomics when building with `tokio_unstable`. This release fixes that. ([#&#8203;4649])

[#&#8203;4649]: https://togithub.com/tokio-rs/tokio/pull/4649

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5:00 and before 6:00 every weekday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/stackabletech/operator-rs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants