Skip to content

LCORE-1332: Update OpenAPI schema#1170

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik:lcore-1332-update-openapi-schema-and-configuration-documentation-
Feb 18, 2026
Merged

LCORE-1332: Update OpenAPI schema#1170
tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik:lcore-1332-update-openapi-schema-and-configuration-documentation-

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Feb 18, 2026

Description

LCORE-1332: Update OpenAPI schema

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
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-1332

Summary by CodeRabbit

  • New Features

    • RAG responses now expose document metadata attributes alongside search results.
    • Added knowledge source identification to provide clarity on which configured index returned each result.
  • Documentation

    • Enhanced RAG endpoint documentation to clarify identifier resolution across different ID formats.
    • Updated field descriptions to better explain document source and metadata information.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Walkthrough

Updated OpenAPI documentation to add new optional fields (attributes in RAGChunk and source in ReferencedDocument) for exposing document metadata and knowledge source identification. Enhanced endpoint description to clarify rag_id resolution via both user-facing and llama-stack vector_store_id. No functional logic changes.

Changes

Cohort / File(s) Summary
OpenAPI Schema Updates
docs/openapi.json, docs/openapi.md
Added RAGChunk.attributes (object/null) for document metadata and ReferencedDocument.source (string/null) for knowledge source indexing. Updated field descriptions and Get Rag endpoint documentation to clarify rag_id resolution flow via vector_store_id.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ 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 clearly identifies the main change as an OpenAPI schema update, which aligns with the changeset focused on docs/openapi.json and docs/openapi.md modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/openapi.json (1)

8624-8639: ⚠️ Potential issue | 🟡 Minor

Update ReferencedDocument description to include source.

The schema now includes source, but the description/Attributes list omits it. This is a doc correctness gap.

✏️ Proposed doc fix
-                "description": "Model representing a document referenced in generating a response.\n\nAttributes:\n    doc_url: Url to the referenced doc.\n    doc_title: Title of the referenced doc."
+                "description": "Model representing a document referenced in generating a response.\n\nAttributes:\n    doc_url: Url to the referenced doc.\n    doc_title: Title of the referenced doc.\n    source: Index name identifying the knowledge source from configuration."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/openapi.json` around lines 8624 - 8639, The ReferencedDocument schema
description is missing the new "source" property; update the description string
for the ReferencedDocument model to document the source field (e.g., add
"source: Index name identifying the knowledge source from configuration" to the
Attributes list) so the schema's description matches the properties, referencing
the ReferencedDocument schema and its "source" property.
🧹 Nitpick comments (2)
docs/openapi.json (2)

1172-1184: Add examples to clarify rag_id resolution.

The new description explains dual ID resolution, but the path parameter lacks concrete examples. Adding examples makes it unambiguous for clients.

💡 Proposed doc enhancement
                 "parameters": [
                     {
                         "name": "rag_id",
                         "in": "path",
                         "required": true,
                         "schema": {
                             "type": "string",
                             "title": "Rag Id"
-                        }
+                        },
+                        "examples": {
+                            "config_rag_id": {
+                                "summary": "User-facing rag_id from config",
+                                "value": "customer-support-rag"
+                            },
+                            "vector_store_id": {
+                                "summary": "Llama Stack vector_store_id",
+                                "value": "vs_7b52a8cf-0fa3-489c-beab-27e061d102f3"
+                            }
+                        }
                     }
                 ],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/openapi.json` around lines 1172 - 1184, Update the OpenAPI path
parameter "rag_id" for operationId get_rag_endpoint_handler_v1_rags__rag_id__get
to include concrete examples showing both a user-facing rag_id (LCORE config ID)
and a llama-stack vector_store_id; modify the "parameters" entry for name
"rag_id" to add an "example" or "examples" object that shows one example labeled
e.g. "config_rag_id" (human-friendly ID) and one labeled "vector_store_id" (UUID
or llama-stack format) so clients can see how dual-ID resolution works.

8366-8377: Add an example for RAGChunk.attributes.

Since attributes is free-form, an explicit example would reduce client guesswork.

🧾 Suggested example
                     "attributes": {
                         "anyOf": [
                             {
                                 "additionalProperties": true,
                                 "type": "object"
                             },
                             {
                                 "type": "null"
                             }
                         ],
                         "title": "Attributes",
-                        "description": "Document metadata from the RAG provider (e.g., url, title, author)"
+                        "description": "Document metadata from the RAG provider (e.g., url, title, author)",
+                        "examples": [
+                            {
+                                "url": "https://example.com/docs/overview",
+                                "title": "Product Overview",
+                                "author": "Docs Team"
+                            }
+                        ]
                     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/openapi.json` around lines 8366 - 8377, Add an explicit example for
RAGChunk.attributes in the OpenAPI schema: update the schema block for
"attributes" under the RAGChunk definition to include an "example" property
showing a representative free-form metadata object (e.g., url, title, author,
created_at or source) so clients see expected keys and value shapes; modify the
"attributes" object in the existing schema (the "attributes" anyOf block) to
include this example field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/openapi.json`:
- Around line 8624-8639: The ReferencedDocument schema description is missing
the new "source" property; update the description string for the
ReferencedDocument model to document the source field (e.g., add "source: Index
name identifying the knowledge source from configuration" to the Attributes
list) so the schema's description matches the properties, referencing the
ReferencedDocument schema and its "source" property.

---

Nitpick comments:
In `@docs/openapi.json`:
- Around line 1172-1184: Update the OpenAPI path parameter "rag_id" for
operationId get_rag_endpoint_handler_v1_rags__rag_id__get to include concrete
examples showing both a user-facing rag_id (LCORE config ID) and a llama-stack
vector_store_id; modify the "parameters" entry for name "rag_id" to add an
"example" or "examples" object that shows one example labeled e.g.
"config_rag_id" (human-friendly ID) and one labeled "vector_store_id" (UUID or
llama-stack format) so clients can see how dual-ID resolution works.
- Around line 8366-8377: Add an explicit example for RAGChunk.attributes in the
OpenAPI schema: update the schema block for "attributes" under the RAGChunk
definition to include an "example" property showing a representative free-form
metadata object (e.g., url, title, author, created_at or source) so clients see
expected keys and value shapes; modify the "attributes" object in the existing
schema (the "attributes" anyOf block) to include this example field.

@tisnik tisnik merged commit 245b35c into lightspeed-core:main Feb 18, 2026
20 of 22 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