Skip to content

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Oct 12, 2025

Description

LCORE-632: updated OpenAPI docs

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Related Tickets & Documents

  • Related Issue #LCORE-632

Summary by CodeRabbit

  • New Features

    • QueryRequest supports media_type to choose response format.
    • QueryResponse adds truncated, input_tokens, output_tokens, and available_quotas.
    • Streaming endpoint returns a typed payload with examples and text/plain support.
  • Refactor

    • Configuration models split into explicit Input and Output variants (authentication, authorization, JWK, JWT).
  • Documentation

    • OpenAPI and guides updated with new fields, examples, and reorganized sections to reflect the Input/Output variants and streaming response details.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 12, 2025

Walkthrough

Refactors OpenAPI schemas to introduce explicit Input/Output variants for authentication, authorization, JWK, and JWT configurations. Expands query models with media_type and new response fields. Updates streaming endpoint response schema/examples. Aligns markdown docs to the new schema structure and fields across openapi.json, openapi.md, and output.md.

Changes

Cohort / File(s) Summary of Changes
OpenAPI schema refactors and streaming updates
docs/openapi.json
Split AuthenticationConfiguration, AuthorizationConfiguration, JwkConfiguration, JwtConfiguration into -Input/-Output variants; updated all references. Enhanced /v1/streaming_query 200 response to explicit string schema with example and text/plain media type. Added QueryRequest.media_type; extended QueryResponse with truncated, input_tokens, output_tokens, available_quotas; updated examples and descriptions.
Markdown OpenAPI reference
docs/openapi.md
Documented new -Input/-Output variants for the above configurations. Added field tables/sections for QueryRequest.media_type and new QueryResponse fields. Adjusted streaming response documentation to reflect schema/media type changes.
Output documentation alignment
docs/output.md
Mirrored new -Input/-Output configuration sections; listed new QueryRequest/QueryResponse fields (including tokens, quotas, truncated). Minor rewording and re-organization to align with updated public entities.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant API as API Server
  participant M as Model Engine
  participant T as Tokenizer
  participant Q as Quota Store

  rect rgba(225,245,254,0.5)
    Note over C,API: Query with optional media_type
    C->>API: POST /v1/query { media_type, ... }
    API->>T: Count input tokens
    T-->>API: input_tokens
    API->>Q: Check available_quotas
    Q-->>API: quotas snapshot
    API->>M: Execute query
  end

  alt Non-streaming
    M-->>API: Response content
    API-->>C: 200 QueryResponse { truncated?, input_tokens, output_tokens, available_quotas }
  else Streaming (text/plain)
    Note over API,C: text/plain with SSE-style lines
    loop Stream chunks
      M-->>API: Chunk
      API-->>C: data: <chunk>\n\n
    end
    API->>T: Count output tokens
    T-->>API: output_tokens
    API-->>C: Final event/summary (tokens, truncated)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

I twitch my whiskers at schemas anew,
Split into Input and Output—so true!
Streams now sing in plain text rain,
Tokens counted, quotas remain.
With tidy docs and carrots in sight,
I hop through APIs—everything’s right. 🥕✨

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 succinctly indicates that this pull request updates the OpenAPI documentation, which aligns precisely with the changes introduced. It is concise, clear, and directly related to the main changeset without extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5baf0cc and 7a366a8.

📒 Files selected for processing (3)
  • docs/openapi.json (13 hunks)
  • docs/openapi.md (9 hunks)
  • docs/output.md (9 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/openapi.md

264-264: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe

(MD055, table-pipe-style)


265-265: Table pipe style
Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe

(MD055, table-pipe-style)


265-265: Table column count
Expected: 3; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-pr
  • GitHub Check: e2e_tests (azure)
  • GitHub Check: e2e_tests (ci)

Comment on lines +264 to +265
| 200 | Streaming response with Server-Sent Events | string
string |
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Restore the streaming response table row.

The 200-status row lost its trailing pipe and now spills onto the next line, so the Markdown table no longer renders correctly (also flagged by markdownlint MD055/MD056). Please collapse it back into a single, fully-piped row.

-| 200 | Streaming response with Server-Sent Events | string
-string |
+| 200 | Streaming response with Server-Sent Events | string (text/event-stream or text/plain) |

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 200 | Streaming response with Server-Sent Events | string
string |
| 200 | Streaming response with Server-Sent Events | string (text/event-stream or text/plain) |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

264-264: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe

(MD055, table-pipe-style)


265-265: Table pipe style
Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe

(MD055, table-pipe-style)


265-265: Table column count
Expected: 3; Actual: 1; Too few cells, row will be missing data

(MD056, table-column-count)

🤖 Prompt for AI Agents
In docs/openapi.md around lines 264-265 the Markdown table row for the 200
response lost its trailing pipe and split across lines, breaking table
rendering; restore that single table row by collapsing the two lines into one
fully-piped row (ensure a trailing pipe at the end) so the row reads as a single
line like: | 200 | Streaming response with Server-Sent Events | string |.

Comment on lines +264 to +265
| 200 | Streaming response with Server-Sent Events | string
string |
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix the broken streaming response table entry.

The Markdown row for the 200 response is split across two lines and missing pipes, so the table misrenders just like in openapi.md (markdownlint MD055/MD056). Please reformat it as a single row.

-| 200 | Streaming response with Server-Sent Events | string
-string |
+| 200 | Streaming response with Server-Sent Events | string (text/event-stream or text/plain) |

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 200 | Streaming response with Server-Sent Events | string
string |
| 200 | Streaming response with Server-Sent Events | string (text/event-stream or text/plain) |
🤖 Prompt for AI Agents
In docs/output.md around lines 264 to 265, the Markdown table row for the 200
response is split across two lines and missing pipe separators; merge the two
lines into a single table row and ensure it has the proper leading/trailing pipe
characters and three columns (status, description, schema) so the row renders
correctly as one line in the table.

@tisnik tisnik merged commit 1971239 into lightspeed-core:main Oct 12, 2025
18 of 20 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.

1 participant