chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
use schemars::JsonSchema;
#[derive(JsonSchema)]
#[serde(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
pub struct Struct1;
#[derive(JsonSchema)]
#[schemars(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
pub struct Struct2;
fn main() {}

View File

@@ -0,0 +1,29 @@
error: expected serde default attribute to be a string: `default = "..."`
--> $DIR/invalid_attrs.rs:4:19
|
4 | #[serde(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
| ^
error: duplicate serde attribute `deny_unknown_fields`
--> $DIR/invalid_attrs.rs:4:48
|
4 | #[serde(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
| ^^^^^^^^^^^^^^^^^^^
error: expected serde default attribute to be a string: `default = "..."`
--> $DIR/invalid_attrs.rs:8:22
|
8 | #[schemars(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
| ^
error: duplicate serde attribute `deny_unknown_fields`
--> $DIR/invalid_attrs.rs:8:51
|
8 | #[schemars(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
| ^^^^^^^^^^^^^^^^^^^
error: unknown schemars attribute `foo`
--> $DIR/invalid_attrs.rs:8:25
|
8 | #[schemars(default = 0, foo, deny_unknown_fields, deny_unknown_fields)]
| ^^^

View File

@@ -0,0 +1,35 @@
use schemars::JsonSchema;
#[derive(JsonSchema)]
pub struct Struct1(#[validate(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
#[derive(JsonSchema)]
pub struct Struct2(#[schemars(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
#[derive(JsonSchema)]
pub struct Struct3(
#[validate(
regex = "foo",
contains = "bar",
regex(path = "baz"),
phone,
email,
url
)]
String,
);
#[derive(JsonSchema)]
pub struct Struct4(
#[schemars(
regex = "foo",
contains = "bar",
regex(path = "baz"),
phone,
email,
url
)]
String,
);
fn main() {}

View File

@@ -0,0 +1,59 @@
error: expected validate regex attribute to be a string: `regex = "..."`
--> $DIR/invalid_validation_attrs.rs:4:39
|
4 | pub struct Struct1(#[validate(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
| ^
error: unknown schemars attribute `foo`
--> $DIR/invalid_validation_attrs.rs:7:42
|
7 | pub struct Struct2(#[schemars(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
| ^^^
error: expected schemars regex attribute to be a string: `regex = "..."`
--> $DIR/invalid_validation_attrs.rs:7:39
|
7 | pub struct Struct2(#[schemars(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
| ^
error: schemars attribute cannot contain both `equal` and `min`
--> $DIR/invalid_validation_attrs.rs:7:63
|
7 | pub struct Struct2(#[schemars(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
| ^^^^^
error: unknown item in schemars length attribute
--> $DIR/invalid_validation_attrs.rs:7:74
|
7 | pub struct Struct2(#[schemars(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
| ^^^
error: schemars attribute cannot contain both `contains` and `regex`
--> $DIR/invalid_validation_attrs.rs:26:9
|
26 | contains = "bar",
| ^^^^^^^^
error: duplicate schemars attribute `regex`
--> $DIR/invalid_validation_attrs.rs:27:9
|
27 | regex(path = "baz"),
| ^^^^^
error: schemars attribute cannot contain both `phone` and `email`
--> $DIR/invalid_validation_attrs.rs:29:9
|
29 | email,
| ^^^^^
error: schemars attribute cannot contain both `phone` and `url`
--> $DIR/invalid_validation_attrs.rs:30:9
|
30 | url
| ^^^
error[E0425]: cannot find value `foo` in this scope
--> $DIR/invalid_validation_attrs.rs:12:17
|
12 | regex = "foo",
| ^^^^^ not found in this scope

View File

@@ -0,0 +1,8 @@
use schemars::JsonSchema_repr;
#[derive(JsonSchema_repr)]
pub enum Enum {
Unit,
}
fn main() {}

View File

@@ -0,0 +1,7 @@
error: JsonSchema_repr: missing #[repr(...)] attribute
--> $DIR/repr_missing.rs:3:10
|
3 | #[derive(JsonSchema_repr)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in the derive macro `JsonSchema_repr` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,10 @@
use schemars::JsonSchema_repr;
#[derive(JsonSchema_repr)]
#[repr(u8)]
pub enum Enum {
Unit,
EmptyTuple(),
}
fn main() {}

View File

@@ -0,0 +1,5 @@
error: JsonSchema_repr: must be a unit variant
--> $DIR/repr_non_unit_variant.rs:7:5
|
7 | EmptyTuple(),
| ^^^^^^^^^^

View File

@@ -0,0 +1,5 @@
use schemars::schema_for;
fn main() {
let _schema = schema_for!(123);
}

View File

@@ -0,0 +1,7 @@
error: This argument to `schema_for!` is not a type - did you mean to use `schema_for_value!` instead?
--> $DIR/schema_for_arg_value.rs:4:19
|
4 | let _schema = schema_for!(123);
| ^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `schema_for` (in Nightly builds, run with -Z macro-backtrace for more info)