Skip to content

feat: server schemas#6

Merged
flrping merged 1 commit intomainfrom
feat/server-requests
Jan 29, 2026
Merged

feat: server schemas#6
flrping merged 1 commit intomainfrom
feat/server-requests

Conversation

@flrping
Copy link
Copy Markdown
Member

@flrping flrping commented Nov 17, 2025

Adds server specific requests and response, mainly for getting data necessary for game function. Example use-case includes fetching all item definitions on server startup.


Summary by cubic

Added server request and response schemas in bees/v1 to standardize server operations. Enables reliable startup data fetches like item definitions.

  • New Features
    • Added server_request.json with date (ISO 8601) and request_type (e.g., SERVER_STATUS, SERVER_RESTART).
    • Added server_response.json with date, request_type, response_status (OK/ERROR), and optional response_message.
    • Bumped schemas VERSION to 1.2.0.

Written for commit bcae453. Summary will update automatically on new commits.

Summary by CodeRabbit

Release Notes

  • Chores

    • Version bumped to 1.2.0
  • New Features

    • Added server request schema supporting timestamps and request type classification
    • Added server response schema with status tracking and optional messaging

@flrping flrping self-assigned this Nov 17, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 17, 2025

Walkthrough

The pull request bumps the schema version from 1.1.0 to 1.2.0 and introduces two new JSON Schema files defining Server Request and Server Response objects with date, request_type, response_status, and response_message properties.

Changes

Cohort / File(s) Change Summary
Version Update
schemas/VERSION
Version string updated from 1.1.0 to 1.2.0
Server Schema Definitions
schemas/bees/v1/server/server_request.json, schemas/bees/v1/server/server_response.json
Two new JSON Schema files added: server_request.json defines Server Request with date and request_type properties; server_response.json defines Server Response with date, request_type, response_status, and response_message properties

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify JSON syntax validity for both new schema files
  • Validate schema structure conventions and property type definitions
  • Confirm examples match declared types and formats

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: server schemas' directly matches the PR's primary change: adding new JSON schema files for server requests and responses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/server-requests

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining why this PR is needed, why this solution was chosen, and what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Copy link
Copy Markdown
Contributor

@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: 1

🧹 Nitpick comments (4)
schemas/bees/v1/server/server_response.json (2)

26-33: Consider adding enum constraints for response_status.

The examples suggest a finite set of status values (OK, ERROR). Using an enum would provide better validation and documentation of valid states.

Apply this diff:

     "response_status": {
         "type": "string",
         "description": "The status of the response",
+        "enum": ["OK", "ERROR"],
         "examples": [
             "OK",
             "ERROR"
         ]
     },

8-45: Consider adding required fields and additionalProperties specification.

The schema lacks required fields and additionalProperties specification, which weakens validation. At minimum, date, request_type, and response_status should likely be required for a valid server response.

Apply this diff:

         }
-    }
+    },
+    "required": ["date", "request_type", "response_status"],
+    "additionalProperties": false
 }
schemas/bees/v1/server/server_request.json (2)

18-25: Consider adding enum constraints for request_type.

The examples suggest a finite set of request types (SERVER_STATUS, SERVER_RESTART). Using an enum would provide better validation and help document the supported request types. This also applies to the request_type field in server_response.json for consistency.

Apply this diff:

     "request_type": {
         "type": "string",
         "description": "The type of server request being made",
+        "enum": ["SERVER_STATUS", "SERVER_RESTART"],
         "examples": [
             "SERVER_STATUS",
             "SERVER_RESTART"
         ]
     }

Similarly update server_response.json line 18-25 to match.


8-26: Consider adding required fields and additionalProperties specification.

The schema lacks required fields and additionalProperties specification, which weakens validation. Both date and request_type should likely be required for a valid server request.

Apply this diff:

         }
-    }
+    },
+    "required": ["date", "request_type"],
+    "additionalProperties": false
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34b46e7 and bcae453.

📒 Files selected for processing (3)
  • schemas/VERSION (1 hunks)
  • schemas/bees/v1/server/server_request.json (1 hunks)
  • schemas/bees/v1/server/server_response.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-05T23:20:45.049Z
Learnt from: flrping
Repo: Project-Hydrius/Pacts PR: 4
File: schemas/VERSION:1-1
Timestamp: 2025-09-05T23:20:45.049Z
Learning: Pacts uses a dual versioning system: 1) Global schema package version (schemas/VERSION) for workflows/releases, and 2) Domain-specific API versions (v1, v2, etc.) that SchemaLoader uses for schema path resolution. SchemaLoader should not use the global VERSION file.

Applied to files:

  • schemas/VERSION
🔇 Additional comments (1)
schemas/VERSION (1)

1-1: LGTM! Version bump is appropriate.

The minor version bump from 1.1.0 to 1.2.0 correctly reflects the addition of new server request/response schemas.

Comment thread schemas/bees/v1/server/server_response.json
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="schemas/bees/v1/server/server_request.json">

<violation number="1" location="schemas/bees/v1/server/server_request.json:18">
`date` and `request_type` are never marked as required, so the schema accepts empty requests instead of enforcing the mandatory metadata.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

"2025-11-20T14:25:15Z"
]
},
"request_type": {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Nov 17, 2025

Choose a reason for hiding this comment

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

date and request_type are never marked as required, so the schema accepts empty requests instead of enforcing the mandatory metadata.

Prompt for AI agents
Address the following comment on schemas/bees/v1/server/server_request.json at line 18:

<comment>`date` and `request_type` are never marked as required, so the schema accepts empty requests instead of enforcing the mandatory metadata.</comment>

<file context>
@@ -0,0 +1,27 @@
+                &quot;2025-11-20T14:25:15Z&quot;
+            ]
+        },
+        &quot;request_type&quot;: {
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;The type of server request being made&quot;,
</file context>
Fix with Cubic

@flrping flrping merged commit 65b262a into main Jan 29, 2026
2 checks passed
@flrping flrping deleted the feat/server-requests branch January 29, 2026 22:12
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.

1 participant