OpenAPI: type SearchHitView.visibility as the Visibility enum (consistency with #29) #38
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from #29 (Tier 3 typed-client). #29 enum-typed the
visibility/data_type/authority-kindfields on the admin object/field/authority View DTOs, butSearchHitView.visibility(crates/api/src/admin_search.rs) is still a plainStringand so generatesstringinweb/src/api/schema.d.tsrather than theVisibilityunion.Effect:
web/src/search/search-result-row.tsxpasseshit.visibility(typedstring) to<VisibilityBadge>, which is why that component's prop stayedvisibility: stringrather than tightening to the union.Ask
SearchHitView.visibilitywith#[schema(value_type = domain::Visibility)](thedomain::Visibilityschema is already registered inopenapi.rsfrom #29;domain::ToSchemais in place per #3 Option A). The runtime field staysString(the search projection builds it from the indexed string) — only the schema description changes.web/src/api/schema.d.ts;SearchHitView.visibilitybecomes the"draft" | "internal" | "public"union.VisibilityBadge's prop to theVisibilityunion now that every caller passes it.Acceptance
SearchHitView.visibilityis theVisibilityunion inschema.d.ts.Small, low-risk; the pattern is exactly the one applied in #29.