Skip to content

Conversation

@c-julin
Copy link
Contributor

@c-julin c-julin commented Dec 10, 2025

Summary

  • Add support for schema normalization parameter when registering schemas to Schema Registry
  • Implement normalize toggle in schema creation UI with Switch component
  • making the change in the existing rest api to get the feature out, part of the connect rpc move we should support all the params in the api.

Changes

Backend

  • backend/pkg/api/handle_schema_registry.go: Added createSchemaRequest type at package level with params.normalize field
  • backend/pkg/console/schema_registry.go: Added CreateSchemaRequestParams and updated CreateSchemaRegistrySchema to pass normalize parameter to Schema Registry via sr.WithParams(ctx, sr.Normalize)
  • backend/pkg/console/servicer.go: Updated interface signature to include params parameter
  • backend/pkg/api/handle_schema_registry_integration_test.go: Added 4 comprehensive tests for normalize parameter with Protobuf enum ordering validation
  • backend/pkg/api/handle_schema_registry_test.go: Added unit tests for normalize parameter parsing and serialization

Frontend

  • frontend/src/components/pages/schemas/schema-create.tsx: Added normalize Switch with tooltip positioned after schema editor, switch on right side of label text
  • frontend/src/state/rest-interfaces.ts: Added optional params.normalize field to SchemaRegistryCreateSchema interface
  • frontend/src/components/pages/schemas/schema-create.test.tsx: Added 6 tests for normalize parameter

Add optional normalize parameter to CreateSchemaRegistrySchema to support
schema normalization. Moves createSchemaRequest to package level following
codebase patterns. Uses sr.WithParams to pass normalize flag to Schema Registry.
Add normalize switch to schema creation form with tooltip. Update
SchemaRegistryCreateSchema interface to support optional params.normalize.
Include integration tests for normalize parameter serialization.
@c-julin c-julin force-pushed the jc/normalise-schema branch from 6a6ec9a to 459ec1d Compare December 15, 2025 11:54
Address PR feedback by extracting a reusable helper function for creating
schemas with optional normalization parameter. This reduces code duplication
across the four test cases and improves test maintainability.

The createSchema helper encapsulates the request structure creation, API
call, and response parsing logic that was previously repeated in each test.
- Split inline expression assignment into separate lines in Switch
  onCheckedChange handler for better readability
- Rename schema-create.test.tsx to .test.ts since it's a pure unit test
  with no React rendering (tests TypeScript interfaces and JSON serialization)
@c-julin c-julin force-pushed the jc/normalise-schema branch from 459ec1d to 63b1528 Compare December 15, 2025 12:44
@c-julin c-julin merged commit 2a7a828 into master Dec 15, 2025
9 checks passed
@c-julin c-julin deleted the jc/normalise-schema branch December 15, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants