[ruff] Update schemars to v1 (#20942)

This commit is contained in:
Takayuki Maeda 2025-10-20 15:59:52 +09:00 committed by GitHub
parent 991e8ed178
commit 48b50128eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 686 additions and 704 deletions

View file

@ -274,15 +274,11 @@ impl<'de> serde::de::Deserialize<'de> for NameImports {
#[cfg(feature = "schemars")]
impl schemars::JsonSchema for NameImports {
fn schema_name() -> String {
"NameImports".to_string()
fn schema_name() -> std::borrow::Cow<'static, str> {
std::borrow::Cow::Borrowed("NameImports")
}
fn json_schema(_gen: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
schemars::schema::SchemaObject {
instance_type: Some(schemars::schema::InstanceType::String.into()),
..Default::default()
}
.into()
fn json_schema(_gen: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::json_schema!({ "type": "string" })
}
}