feat:Add unix_timestamp format to from in payment usage OpenAPI docs#211
feat:Add unix_timestamp format to from in payment usage OpenAPI docs#211
Conversation
WalkthroughOpenAPI descriptions were updated for the “from” query parameter and the “From” schema to mention unix_timestamp (seconds, UTC) formatting alongside existing YYYY.MM and current(-N) formats for GET /payment/usage and GET /payment/usage/{api_token}. No types, requirements, or responses changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (5)
src/libs/DeepInfra/openapi.yaml (5)
3560-3568: Consider adding concrete examples to reduce ambiguity for multi-format "from" parameterType is string while allowing a unix timestamp; adding named examples will make client generation and human usage clearer without changing the schema shape.
Apply this diff to include examples alongside the updated description:
- name: from in: query - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + examples: + yyyy_mm: + summary: Year and month + value: '2025.08' + relative: + summary: Relative current month + value: 'current-1' + unix_ts: + summary: Unix timestamp (seconds, UTC) + value: '1723939200' required: true schema: title: From - type: string - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + type: string + description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format'
3560-3568: Optional: Model the input more precisely with oneOf (string formats or integer unix ts)If the backend accepts both numeric and string inputs, you can advertise that precisely and help codegen by using oneOf. If not, skip this.
- name: from in: query - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' required: true schema: title: From - type: string - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + oneOf: + - type: string + description: "YYYY.MM or 'current' or 'current-N'" + - type: integer + format: int64 + description: 'Unix timestamp in seconds (UTC)'Note: This is a non-breaking documentation improvement if the server already accepts both representations.
3562-3562: Nit: Align terminology with the rest of the specElsewhere you use phrasing like "seconds since unix epoch". Consider changing "unix_timestamp (in seconds, UTC)" to "seconds since Unix epoch (UTC)" for consistency.
- description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + description: 'start of period in YYYY.MM, current(-N), seconds since Unix epoch (UTC) format' ... - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + description: 'start of period in YYYY.MM, current(-N), seconds since Unix epoch (UTC) format'Also applies to: 3567-3567
3640-3654: DRY the “from” parameter across both usage endpoints to prevent driftYou updated the description in two places. To avoid future inconsistencies, extract a shared parameter in components and $ref it here and in /payment/usage.
Minimal change here (reference a shared parameter):
- - name: from - in: query - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' - required: true - schema: - title: From - type: string - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + - $ref: '#/components/parameters/UsageFromParam'And add this parameter once under components (outside this hunk):
components: parameters: UsageFromParam: name: from in: query description: "start of period in YYYY.MM, current(-N), seconds since Unix epoch (UTC) format" required: true examples: yyyy_mm: summary: Year and month value: "2025.08" relative: summary: Relative current month value: "current-1" unix_ts: summary: Unix timestamp (seconds, UTC) value: "1723939200" schema: type: string description: "start of period in YYYY.MM, current(-N), seconds since Unix epoch (UTC) format"
3648-3654: Mirror the examples/oneOf enhancement on the token-specific endpoint as wellKeep both endpoints aligned to avoid client confusion.
Apply this diff mirroring the examples block:
- name: from in: query - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + examples: + yyyy_mm: + summary: Year and month + value: '2025.08' + relative: + summary: Relative current month + value: 'current-1' + unix_ts: + summary: Unix timestamp (seconds, UTC) + value: '1723939200' required: true schema: title: From type: string - description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format' + description: 'start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/DeepInfra/openapi.yaml(2 hunks)
⏰ 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). (1)
- GitHub Check: Test / Build, test and publish
Summary by CodeRabbit