Skip to content

feat(chat): add chat api schemas#27

Merged
vitramir merged 1 commit intomainfrom
noa/issue-26
Mar 13, 2026
Merged

feat(chat): add chat api schemas#27
vitramir merged 1 commit intomainfrom
noa/issue-26

Conversation

@casey-brooks
Copy link
Contributor

Summary

  • add chat proto definitions in proto/agynio/api/chat/v1/chat.proto
  • add chat OpenAPI v1 schemas under openapi/chat/v1

Testing

  • buf lint
  • redocly bundle openapi/team/v1/openapi.yaml -o dist/team-v1.yaml
  • redocly bundle openapi/files/v1/openapi.yaml -o dist/files-v1.yaml
  • redocly bundle openapi/llm/v1/openapi.yaml -o dist/llm-v1.yaml
  • redocly bundle openapi/chat/v1/openapi.yaml -o dist/chat-v1.yaml
  • spectral lint dist/team-v1.yaml
  • spectral lint dist/files-v1.yaml
  • spectral lint dist/llm-v1.yaml
  • spectral lint dist/chat-v1.yaml

Closes #26

@casey-brooks casey-brooks requested a review from a team as a code owner March 13, 2026 13:33
@github-actions
Copy link

The latest Buf updates on your PR. Results from workflow buf-pr / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 13, 2026, 1:33 PM

@casey-brooks
Copy link
Contributor Author

Summary

  • added chat proto definitions in proto/agynio/api/chat/v1/chat.proto
  • added chat OpenAPI v1 schemas under openapi/chat/v1

Test & Lint Summary

Commands:

  • buf lint
  • redocly bundle openapi/team/v1/openapi.yaml -o dist/team-v1.yaml
  • redocly bundle openapi/files/v1/openapi.yaml -o dist/files-v1.yaml
  • redocly bundle openapi/llm/v1/openapi.yaml -o dist/llm-v1.yaml
  • redocly bundle openapi/chat/v1/openapi.yaml -o dist/chat-v1.yaml
  • spectral lint dist/team-v1.yaml
  • spectral lint dist/files-v1.yaml
  • spectral lint dist/llm-v1.yaml
  • spectral lint dist/chat-v1.yaml

Results:

  • Tests: passed 0, failed 0, skipped 0
  • Lint: spectral warnings about missing info contact/description and operationId in existing specs; no errors

@rowan-stein
Copy link
Collaborator

Requesting review. This PR adds the Chat service API schemas — both proto (gRPC) and OpenAPI (REST). CI is green (buf lint + OpenAPI validation passed).

Copy link

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Clean, well-structured addition. Proto and OpenAPI schemas are consistent with each other and with the existing repo conventions. All 5 RPCs and 5 REST endpoints from the issue spec are covered, cursor-based pagination is correctly applied, and identity is properly kept out of request bodies.

Two minor notes left inline — nothing blocking.

fileIds:
type: array
items: { type: string, format: uuid }
description: File references (UUIDs). May be empty when body is non-empty.

Choose a reason for hiding this comment

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

[minor] This schema has no required list, so {} is a valid request body at the schema level. The "at least one of body or fileIds" rule is documented in the description but is invisible to schema validators and codegen.

Consider adding a comment or using an OpenAPI description on the schema itself to make it explicit this is enforced server-side. Alternatively, if there's a dominant use case (e.g., most messages have a body), you could require body and keep fileIds optional — though that changes the contract slightly.

Not a blocker since the constraint is well-documented in descriptions here and in the proto, but worth noting for consumers relying on schema validation.

@@ -0,0 +1,51 @@
get:
operationId: getChats

Choose a reason for hiding this comment

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

[nit] The chat path files include operationId (e.g., getChats, createChat, getChatMessages, etc.) while the existing llm/team/files specs do not use operationId at all. This is good practice for codegen and documentation, but creates a style inconsistency across the repo.

Not blocking — ideally the older specs would be backfilled with operationId too. Just flagging the drift.

@vitramir vitramir merged commit 97b7cbe into main Mar 13, 2026
3 checks passed
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.

Add Chat service API schemas (proto + OpenAPI)

4 participants