-
-
Notifications
You must be signed in to change notification settings - Fork 13
feat:Relax enums to strings in Ollama OpenAPI schema #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughOpenAPI 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
There was a problem hiding this 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
⛔ 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 referencessuccess
. 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 changeDoneReason 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 ResponseFormatSearch 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.
Summary by CodeRabbit
Documentation
Chores