Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 22, 2025

Summary by CodeRabbit

  • Documentation

    • Updated API specification to remove strict enum values for several fields (ResponseFormat, DoneReason, CreateModelStatus, PullModelStatus), allowing broader string values in responses and statuses.
    • Reflects more flexible API behavior in the docs for improved compatibility with varying upstream responses.
  • Chores

    • Maintained OpenAPI schema to simplify validations and reduce tight coupling to specific enum values.

Copy link

coderabbitai bot commented Sep 22, 2025

Walkthrough

OpenAPI schema updates in src/libs/Ollama/openapi.yaml remove specific enum values for several components (ResponseFormat, DoneReason, CreateModelStatus, PullModelStatus), replacing them with generic string types within oneOf/anyOf branches. No new methods or signatures; only schema enumerations were relaxed.

Changes

Cohort / File(s) Summary
OpenAPI schema adjustments
src/libs/Ollama/openapi.yaml
- ResponseFormat: removed explicit "json" enum branch; retained descriptive/string alternative in oneOf.
- DoneReason: removed enum values (stop, length, load); left plain string in anyOf.
- CreateModelStatus: removed enum values (creating system layer, parsing modelfile, success); left plain string in anyOf.
- PullModelStatus: removed enum values (pulling manifest, downloading digestname, verifying sha256 digest, writing manifest, removing any unused layers, success); left plain string in anyOf.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble docs with careful cheer,
Trimming enums far and near—
Strings now roam the schema plain,
Less boxed-in, a wider lane.
Thump-thump! my paws approve the file,
OpenAPI, sleek in style. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is a commit-style prefix plus an @mention and does not describe the PR's actual changes. The changeset modifies src/libs/Ollama/openapi.yaml by removing explicit enum values for ResponseFormat, DoneReason, CreateModelStatus, and PullModelStatus. Because the title does not summarize the primary change or affected component, it is vague and non-descriptive. Please replace the title with a short, descriptive sentence that names the affected component and primary change, for example: "feat(ollama): relax enums in src/libs/Ollama/openapi.yaml" or "chore(openapi): remove explicit enum values from Ollama response and status types". Make it a single concise sentence so reviewers immediately understand the PR intent. After updating the title, the check should be re-evaluated.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 bot/update-openapi_202509220638

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.

@HavenDV HavenDV enabled auto-merge (squash) September 22, 2025 06:39
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Relax enums to strings in Ollama OpenAPI schema Sep 22, 2025
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 (1)
src/libs/Ollama/openapi.yaml (1)

1082-1091: Inconsistent schema pattern: PushModelResponse retains enum values while others were removed.

PushModelResponse still maintains explicit enum values (retrieving manifest, starting upload, pushing manifest, success) in its anyOf structure, while other similar schemas had their enums removed. This creates inconsistency in the API schema design.

Consider whether PushModelResponse should follow the same pattern as the other status schemas for consistency:

         status:
           anyOf:
             - type: string
-            - enum:
-                - retrieving manifest
-                - starting upload
-                - pushing manifest
-                - success
-              type: string
+            - type: string
           description: Status pushing the model.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 623d920 and f5785df.

⛔ Files ignored due to path filters (26)
  • src/libs/Ollama/Generated/Ollama..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.CreateModelStatus.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.CreateModelStatusEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.CreateModelStatusEnumNullable.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.DoneReason.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.DoneReasonEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.DoneReasonEnumNullable.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.PullModelStatus.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.PullModelStatusEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.PullModelStatusEnumNullable.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.ResponseFormat.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.ResponseFormatEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonConverters.ResponseFormatEnumNullable.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.CreateModelStatusEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.DoneReasonEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.PullModelStatusEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.ResponseFormat.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.ResponseFormatEnum.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.ResponseFormatVariant1.Json.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.ResponseFormatVariant1.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.ResponseFormatVariant2.Json.g.cs is excluded by !**/generated/**
  • src/libs/Ollama/Generated/Ollama.Models.ResponseFormatVariant2.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Ollama/openapi.yaml (4 hunks)
🔇 Additional comments (4)
src/libs/Ollama/openapi.yaml (4)

767-771: Verify if removing CreateModelStatus enum values affects status monitoring. src/libs/Ollama/openapi.yaml (lines 763–771) now defines CreateModelStatus as anyOf string types (explicit enum values removed) while the description still references success. Repo search found no in-repo usages of the removed status strings, but this change can break external clients or monitoring code — confirm compatibility or restore explicit enum values.


1049-1053: Verify removing PullModelStatus enum values won't break pull progress handling

  • Finding: only occurrence is src/libs/Ollama/openapi.yaml (PullModelStatus now defined as anyOf: string; example "pulling manifest"); no other repo references found.
  • Action: verify external API consumers / generated SDKs / monitoring code that parse these statuses — if they depend on fixed enum values, restore the enum or provide a backward-compatible mapping/documentation.

609-613: Verify DoneReason enum removal — potential breaking change

DoneReason now accepts any string (src/libs/Ollama/openapi.yaml: lines 609–613); repo search found no other references. This relaxes validation and may break downstream clients or generated SDKs that expect enum values "stop", "length", "load". Restore the enum values or treat as a breaking API change (version bump + notify/regenerate consumers).


444-448: Restore explicit 'json' enum or confirm/document the breaking change for ResponseFormat

Search shows ResponseFormat is only defined/referenced in src/libs/Ollama/openapi.yaml (schema at lines 444–448; $refs at 289 and 538). No internal uses of the literal "json" were found. Removing the explicit enum can break external clients that validate against the OpenAPI schema — either re-add enum: ['json'] to the ResponseFormat schema or add a breaking-change note and bump the API version.

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