Skip to content

feat:Standardize OpenAPI spec: ISO 8601 dates and array defaults#134

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603091235
Mar 9, 2026
Merged

feat:Standardize OpenAPI spec: ISO 8601 dates and array defaults#134
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603091235

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Mar 9, 2026

Summary by CodeRabbit

  • Documentation
    • Standardized datetime representations across API specifications to ISO 8601 format with explicit timezone offsets.
    • Updated API schema examples and default values for consistency across endpoints.
    • Enhanced clarity of optional array fields in API documentation.

@github-actions github-actions bot enabled auto-merge March 9, 2026 12:35
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Walkthrough

This pull request standardizes the OpenAPI specification for the Ideogram API by converting datetime representations to explicit ISO 8601 format with timezone offsets (+00:00) across all example payloads and responses, introducing default: [] for array-type fields in public schemas, and adding security: [] blocks to internal-testing endpoints.

Changes

Cohort / File(s) Summary
OpenAPI Specification Updates
src/libs/Ideogram/openapi.yaml
Standardizes all datetime fields (start_time, end_time, issued_time, created, etc.) to ISO 8601 format with +00:00 timezone offset; adds default: [] to multiple array-type public schemas (current_api_keys, profiles, invoices, organization_members, etc.); adds empty security: [] blocks to internal-testing endpoint; updates example payloads across GetUsageInfoResponse, ListOrganizationInvoicesResponse, SpendCommitInfoResponse, GetApiKeysResponse, GetApiKeysV2Response, GetApiProfilesResponse, ApiProfile, and related components to reflect new formatting conventions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Timestamps march in perfect rows,
ISO-formatted in uniform shows,
With +00:00 and defaults in place,
Our schemas now keep a consistent pace! ⏰

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: standardizing datetime formats to ISO 8601 and adding default array values in the OpenAPI spec.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202603091235

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.

@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Standardize OpenAPI spec: ISO 8601 dates and array defaults Mar 9, 2026
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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libs/Ideogram/openapi.yaml`:
- Around line 553-562: The example responses in openapi.yaml include fields that
don't match the defined schemas: the Invoice schema expects invoice_status (not
status) and does not define invoice_paid_date, and the SpendCommitInfo schema
expects commit_amount_spent (not commit_spend_balance); update the example
objects under the invoices and spend commit examples to use the exact schema
property names (replace status→invoice_status, remove invoice_paid_date or move
its value to a schema-approved field, and replace
commit_spend_balance→commit_amount_spent) so examples fully conform to the
Invoice and SpendCommitInfo schemas referenced in the spec.
- Around line 3895-3902: The examples for ApiProfileApiKey currently set
ApiProfileApiKey.status to null which violates the non-null ApiKeyStatus enum
(ACTIVE | DISABLED); update each example instance (the example objects
containing creation_time, redacted_api_key, api_key_id) to use a valid
ApiKeyStatus value (e.g., "ACTIVE" or "DISABLED") for the status field, or if
null is legitimately possible, change the ApiKeyStatus schema to allow null
(widen the schema) so examples and schema agree; apply this fix for all similar
example blocks (the repeated example objects near the shown creation_time
entries).
- Line 175: The operation-level "security: []" entry is explicitly disabling the
root ApiKeyAuth requirement and making the endpoint unauthenticated; remove the
`security: []` line (or replace it with the appropriate security requirement
referencing the root `ApiKeyAuth`) so the operation inherits the global
authentication, ensuring the endpoint is not left public.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 549d3553-6861-4bd7-ab58-71e90750b961

📥 Commits

Reviewing files that changed from the base of the PR and between 4316280 and 9513c31.

⛔ Files ignored due to path filters (79)
  • src/libs/Ideogram/Generated/Ideogram.IManageClient.AddOrganizationMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUsageInfo.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IManageClient.PromoteOrganizationMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IManageClient.RemoveOrganizationMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.ManageClient.AddOrganizationMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUsageInfo.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.ManageClient.PromoteOrganizationMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.ManageClient.RemoveOrganizationMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationMembersRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.TextLayerV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Ideogram/openapi.yaml

application/json:
schema:
$ref: '#/components/schemas/postInternalTesting_200_response'
security: [ ]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

In OpenAPI, does an operation-level security: [] override top-level security and make the operation unauthenticated?

💡 Result:

Yes. In OpenAPI, an operation’s security overrides the top-level (global) security. If you set an operation to:

security: []

that explicitly removes the global security requirement for that operation—i.e., the operation has no required authentication (from the spec’s point of view). If you want the operation to use the global security, omit the operation-level security field instead. [1], [2]

Sources:
[1] OpenAPI Specification (security override + empty array removes top-level security) (spec.openapis.org)
[2] Swagger docs (global security can be overridden per-operation, including “no authentication”) (swagger.io)

Citations:


Remove security: [] unless this endpoint is intentionally public.

Setting security: [] at the operation level explicitly overrides the root ApiKeyAuth requirement, making this endpoint unauthenticated per the OpenAPI spec. For an internal-testing endpoint, this is likely unintended and would drop authentication at the gateway/client layer.

Suggested fix
-      security: [ ]
📝 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
security: [ ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/Ideogram/openapi.yaml` at line 175, The operation-level "security:
[]" entry is explicitly disabling the root ApiKeyAuth requirement and making the
endpoint unauthenticated; remove the `security: []` line (or replace it with the
appropriate security requirement referencing the root `ApiKeyAuth`) so the
operation inherits the global authentication, ensuring the endpoint is not left
public.

Comment on lines 553 to +562
example:
invoices:
- start_time: '2024-01-01'
end_time: '2024-01-31T23:59:59.0000000+00:00'
- start_time: '2024-01-01T00:00:00+00:00'
end_time: '2024-01-31T23:59:59+00:00'
total_spend:
currency_code: USD
amount: 15000
status: PAID
issued_time: '2024-02-01'
invoice_paid_date: '2024-02-05T10:30:00.0000000+00:00'
issued_time: '2024-02-01T00:00:00+00:00'
invoice_paid_date: '2024-02-05T10:30:00+00:00'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

These response examples still don't match their referenced schemas.

While updating the timestamps, these payloads kept fields that the schemas do not define: Invoice uses invoice_status and has no invoice_paid_date, and SpendCommitInfo uses commit_amount_spent, not commit_spend_balance. Invalid examples are easy to propagate into docs and generated tests.

Suggested fix
-                    status: PAID
+                    invoice_status: PAID
-                    invoice_paid_date: '2024-02-05T10:30:00+00:00'

-                  - commit_spend_balance:
+                  - commit_amount_spent:

Also applies to: 805-813

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/Ideogram/openapi.yaml` around lines 553 - 562, The example responses
in openapi.yaml include fields that don't match the defined schemas: the Invoice
schema expects invoice_status (not status) and does not define
invoice_paid_date, and the SpendCommitInfo schema expects commit_amount_spent
(not commit_spend_balance); update the example objects under the invoices and
spend commit examples to use the exact schema property names (replace
status→invoice_status, remove invoice_paid_date or move its value to a
schema-approved field, and replace commit_spend_balance→commit_amount_spent) so
examples fully conform to the Invoice and SpendCommitInfo schemas referenced in
the spec.

items:
$ref: '#/components/schemas/RedactedApiKey'
description: The current API keys that are active. Only returns redacted keys.
default: [ ]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

for file in \
  src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs \
  src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.g.cs \
  src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.g.cs \
  src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs
do
  echo "== $file =="
  sed -n '1,140p' "$file" | rg -n "Default Value: \[\]|IList<|JsonRequired|= new global::System.Collections.Generic.List|= \[\]"
  echo
done

Repository: tryAGI/Ideogram

Length of output: 2415


Spec-to-code mismatch: default: [] in OpenAPI spec not materialized in generated C# models.

The OpenAPI spec documents default: [] for collection properties, and the C# code generation includes this in XML documentation comments (/// Default Value: []). However, the generated properties lack initializers—some are nullable without defaults, others are marked required without initializers. This breaks the contract: the spec promises empty arrays, but the SDK offers null or uninitialized collections.

Either initialize these properties to empty lists in codegen (= new List<>() or = []), or remove the default: [] from the OpenAPI spec.

Also applies to lines: 3885-3885, 3957-3957, 4050-4050, 4106-4106, 4207-4207, 4265-4265, 4310-4310, 4331-4331, 4352-4352, 4442-4442

Comment on lines +3895 to +3902
- creation_time: '2000-01-23T04:56:07+00:00'
redacted_api_key: ATG56•••••••••••••
api_key_id: JRPVD7jWR1aTBYiJ0UFVOg
status: ''
- creation_time: '2000-01-23T04:56:07.0000000+00:00'
status: null
- creation_time: '2000-01-23T04:56:07+00:00'
redacted_api_key: ATG56•••••••••••••
api_key_id: JRPVD7jWR1aTBYiJ0UFVOg
status: ''
status: null
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use a real ApiKeyStatus value in these examples.

ApiProfileApiKey.status is required and its schema is the non-null enum ACTIVE | DISABLED, but the updated examples set it to null. That leaves the examples invalid against the schema.

Suggested fix
-                status: null
+                status: ACTIVE

If null is actually possible in responses, the schema needs to be widened instead.

Also applies to: 3911-3918, 3975-3982, 4024-4030, 4210-4217

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/Ideogram/openapi.yaml` around lines 3895 - 3902, The examples for
ApiProfileApiKey currently set ApiProfileApiKey.status to null which violates
the non-null ApiKeyStatus enum (ACTIVE | DISABLED); update each example instance
(the example objects containing creation_time, redacted_api_key, api_key_id) to
use a valid ApiKeyStatus value (e.g., "ACTIVE" or "DISABLED") for the status
field, or if null is legitimately possible, change the ApiKeyStatus schema to
allow null (widen the schema) so examples and schema agree; apply this fix for
all similar example blocks (the repeated example objects near the shown
creation_time entries).

@HavenDV HavenDV disabled auto-merge March 9, 2026 13:02
@HavenDV HavenDV merged commit e83c0fc into main Mar 9, 2026
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202603091235 branch March 9, 2026 13:02
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