Skip to content

Conversation

@sandhose
Copy link
Member

This upgrades schemars and aide to their latest versions.

This changes a little bit the generated config and adminapi schemas, but at a first glance nothing major.

@sandhose sandhose force-pushed the quenting/schemars-0.9 branch from dd12f94 to a35db23 Compare June 12, 2025 13:48
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 12, 2025

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: db2288b
Status: ✅  Deploy successful!
Preview URL: https://eeffbb6d.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-schemars-0-9.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose requested a review from a team as a code owner November 7, 2025 09:54
@sandhose sandhose requested a review from Copilot November 7, 2025 10:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the schemars library from version 0.8.22 to 0.9.0, along with the aide library from 0.14.2 to 0.15.1. The changes update the JSON Schema generation code to use the new API, migrate from the deprecated nullable approach to using type arrays with null, and adjust various schema attribute definitions. The upgrade also removes workarounds for old dependency version conflicts with indexmap and hashbrown.

Key Changes

  • Upgraded schemars from 0.8.22 to 0.9.0 and aide from 0.14.2 to 0.15.1
  • Migrated from nullable: true to type: ["string", "null"] pattern for optional fields in JSON schemas
  • Updated custom JsonSchema implementations to use new API (json_schema! macro, Cow<'static, str> for schema names)
  • Changed #[schemars(example = "function")] to #[schemars(example = &"value")] or #[schemars(example = value)] for inline values

Reviewed Changes

Copilot reviewed 20 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Cargo.toml Updated schemars to 0.9.0, aide to 0.15.1, changed schemars features from url, chrono to url2, chrono04, removed schemars feature from ipnetwork
Cargo.lock Lockfile updates for dependency changes
deny.toml Removed skip entries for old indexmap/hashbrown versions no longer needed
crates/policy/src/bin/schema.rs Migrated schema settings API, removed option_nullable settings
crates/iana/src/oauth.rs Updated JsonSchema implementations to use new API with json_schema! macro
crates/iana-codegen/src/generation.rs Updated code generator to produce new schemars API code
crates/iana-codegen/src/main.rs Added rustls crypto provider initialization
crates/iana-codegen/Cargo.toml Added rustls dependency
crates/handlers/src/admin/v1/users/set_password.rs Changed example attribute from function to static reference
crates/handlers/src/admin/v1/policy_data/set.rs Changed example from function name to function call
crates/handlers/src/admin/schema.rs Updated custom JsonSchema implementations for ULID and DeviceID types
crates/handlers/src/admin/mod.rs Added transform to remove AddNullable for OpenAPI 3.1 compatibility
crates/config/src/sections/telemetry.rs Removed example functions, inlined values in attributes
crates/config/src/sections/secrets.rs Changed example from function to static reference
crates/config/src/sections/http.rs Changed examples from functions to static references, added schema override for trusted_proxies
crates/config/src/schema.rs Updated Hostname JsonSchema implementation
crates/config/src/bin/schema.rs Migrated schema settings API
policies/schema/*.json Updated to use type arrays instead of nullable, reordered required fields
docs/config.schema.json Large schema regeneration with new format
docs/api/spec.json API schema regeneration with new format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

not too bad actually

Comment on lines +178 to +179
// valid with OpenAPI 3.1. For some reason, aide/schemars output
// an OpenAPI 3.1 schema with this nullable transform.
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be reported & issue tracked here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if it's an aide or a schemars thing… I can't really find related issues, but also there is a bunch of cleaning up happening on the aide side happening on the main branch; maybe we should just wait for the next release and see?

@sandhose sandhose merged commit 52eec4c into main Nov 7, 2025
26 checks passed
@sandhose sandhose deleted the quenting/schemars-0.9 branch November 7, 2025 13:08
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