Skip to content

Conversation

@BenPope
Copy link
Member

@BenPope BenPope commented Sep 17, 2025

#19 but on this Repo

@BenPope BenPope requested a review from a team as a code owner September 17, 2025 15:51
@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

📝 Walkthrough

Walkthrough

The OpenAPI schema for schema-registry.json was updated to adjust response and parameter references and enrich compatibility definitions. GET /schemas/ids/{id} now returns a payload via $ref to definitions/schema_def instead of an inline object. A body parameter named schema_def now references definitions/stored_schema rather than definitions/schema_def. Definitions for get_compatibility.compatibilityLevel and put_compatibility.compatibility were expanded to include description, example, and an enum of allowed string values.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant API as Schema Registry API
  participant Def as Schema Definitions

  Note over API,Def: GET /schemas/ids/{id}
  C->>API: GET /schemas/ids/{id}
  API->>Def: Resolve $ref: definitions/schema_def
  Def-->>API: schema_def structure
  API-->>C: 200 body: schema_def (via $ref)
  Note over API: Response no longer inline {schemaType, schema}
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant API as Schema Registry API
  participant Def as Schema Definitions

  rect rgba(230, 245, 255, 0.4)
  Note over API,Def: Submit schema using body param "schema_def"
  C->>API: POST/PUT ... body: stored_schema
  API->>Def: Validate against definitions/stored_schema
  Def-->>API: Validation result
  API-->>C: Success or error
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant API as Schema Registry API
  participant Def as Schema Definitions

  Note over API,Def: Compatibility configuration
  C->>API: GET /config
  API->>Def: Resolve get_compatibility.compatibilityLevel (enum, example, desc)
  API-->>C: 200 body with compatibilityLevel

  C->>API: PUT /config { compatibility }
  API->>Def: Validate compatibility against enum
  API-->>C: 200 on valid • 4xx on invalid
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "Schema-Registry: Update for v25.2.2" is concise, names the affected component and target version, and directly relates to the changes in the schema-registry JSON (response schema refs and compatibility fields), making it a clear summary for reviewers.
Description Check ✅ Passed The description cites the corresponding PR in the other repository, which ties it to the current changeset and therefore meets the lenient requirement that the description not be completely off-topic, although it is minimal and does not summarize the specific modifications.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch schema-registry-v25.2.2

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🤖 API structural change detected:

Modified (2)

  • GET /schemas/ids/{id}
    • Response modified: 200
      • Content type modified: application/vnd.schemaregistry.v1+json
        • Property added: references
      • Content type modified: application/vnd.schemaregistry+json
        • Property added: references
      • Content type modified: application/json
        • Property added: references
  • POST /subjects/{subject}/versions
    • Content type modified: application/vnd.schemaregistry.v1+json
      • Properties added: subject, version, id
    • Content type modified: application/vnd.schemaregistry+json
      • Properties added: subject, version, id
    • Content type modified: application/json
      • Properties added: subject, version, id

Preview documentation

Powered by Bump.sh

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
schema-registry/schema-registry.json (2)

829-833: Intentional use of stored_schema here looks correct; add a brief param description to avoid confusion.

Matches prior maintainer guidance that this endpoint accepts stored_schema rather than schema_def. Consider clarifying with a short description on the body parameter.

Apply:

           {
             "name": "schema_def",
             "in": "body",
+            "description": "Request body uses stored_schema (includes subject, version, id, schemaType, references, schema).",
             "schema": {
-              "$ref": "#/definitions/stored_schema"
+              "$ref": "#/definitions/stored_schema"
             }
           }

1223-1226: Typo in definition name is_compatibile (one “l”) — consider correcting with an alias to avoid breaking $refs.

If you want to fix it now, add a new correctly spelled definition and point $refs to it; retain the old one as a temporary alias to avoid churn.

Apply:

-    "is_compatibile": {
+    "is_compatible": {
       "type": "object",
       "properties": {
         "is_compatible": {
           "type": "boolean"
         },
         "messages": {
           "type": "array",
           "items": {
             "type": "string"
           }
         }
       }
     },
+    "is_compatibile": { "$ref": "#/definitions/is_compatible" },

And update the $ref at the response:

-              "$ref": "#/definitions/is_compatibile"
+              "$ref": "#/definitions/is_compatible"

Also applies to: 1584-1597

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1c13306 and 2c98669.

📒 Files selected for processing (1)
  • schema-registry/schema-registry.json (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: BenPope
PR: redpanda-data/api-docs#19
File: schema-registry/schema-registry.json:829-833
Timestamp: 2025-08-22T15:23:48.814Z
Learning: In the Redpanda Schema Registry API (schema-registry/schema-registry.json), the POST /subjects/{subject}/versions endpoint intentionally uses stored_schema (which includes id, subject, version fields) as the request body schema reference instead of schema_def, as confirmed by the API maintainer BenPope.
📚 Learning: 2025-08-22T15:23:48.814Z
Learnt from: BenPope
PR: redpanda-data/api-docs#19
File: schema-registry/schema-registry.json:829-833
Timestamp: 2025-08-22T15:23:48.814Z
Learning: In the Redpanda Schema Registry API (schema-registry/schema-registry.json), the POST /subjects/{subject}/versions endpoint intentionally uses stored_schema (which includes id, subject, version fields) as the request body schema reference instead of schema_def, as confirmed by the API maintainer BenPope.

Applied to files:

  • schema-registry/schema-registry.json
🔇 Additional comments (3)
schema-registry/schema-registry.json (3)

1554-1558: Enums/examples for get_compatibility are a nice improvement.

Clearer contract for clients; no issues spotted.


1565-1569: Enums/examples for put_compatibility look good.

Keeps request/response symmetry and improves client validation.


459-464: Approve — GET /schemas/ids/{id} uses reusable schema_def; $refs verified OK.

@BenPope BenPope closed this in a6fca53 Sep 17, 2025
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.

2 participants