Skip to content

feat: API specs update for version 1.9.x#84

Merged
ChiragAgg5k merged 1 commit into
mainfrom
feat-1.9.x-specs
Jun 24, 2026
Merged

feat: API specs update for version 1.9.x#84
ChiragAgg5k merged 1 commit into
mainfrom
feat-1.9.x-specs

Conversation

@appwrite-specs

Copy link
Copy Markdown
Contributor

This PR contains API specification updates for version 1.9.x.

@ChiragAgg5k ChiragAgg5k merged commit 7d74bf9 into main Jun 24, 2026
2 checks passed
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the 1.9.x API specs and generated examples. The main changes are:

  • OAuth2 resource indicator fields and Python OAuth2 examples.
  • Batched usage metrics request and response schemas.
  • Function and site specification type parameters.
  • Database execution and transaction metadata updates.
  • New Python Apps examples.

Confidence Score: 3/5

Several schema/example mismatches can affect generated clients, docs, and validation workflows, so the spec updates need targeted fixes before merging.

The review covered the changed OpenAPI specs and generated examples, with focused runtime checks confirming the main type-shape issues in the spec data.

specs/1.9.x/open-api3-1.9.x-client.json, specs/1.9.x/open-api3-1.9.x-server.json, examples/1.9.x/server-nodejs/examples/usage/list-events.md, examples/1.9.x/server-graphql/examples/usage/list-events.md

T-Rex T-Rex Logs

What T-Rex did

  • Reproduced a resource default type mismatch in the OAuth2 authorize endpoint by running a Node validation harness against specs/1.9.x/open-api3-1.9.x-client.json.
  • Validated the usageEventList metrics example with a focused Python validator against specs/1.9.x/open-api3-1.9.x-server.json.
  • Validated the usageGaugeList metrics example with a focused runtime validator against specs/1.9.x/open-api3-1.9.x-server.json.
  • Compared pre- and post-contract results using openapi_contract_check.py, and the after run shows 12 passes and 0 failures.
  • Compared OLD_OR_MISMATCH classifications before and after, showing a drop from 26 to 0 across 50 changed files with updated type arguments and metrics forms.
  • Verified that all 19 requested example markdown files are present; 11 Apps examples match endpoints and required parameters, while 8 OAuth2 examples align with real operations but lack project_id coverage.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 OAuth2 Python examples omit required project_id path parameter

    • Bug
      • All new Python server OAuth2 examples call the correct OAuth2 methods, but none pass project_id even though the corresponding 1.9.x server OpenAPI paths are under /oauth2/{project_id}/... and mark project_id as required. A copier using these examples will not provide the required path parameter for approve, authorize, create_device_authorization, create_grant, create_token, get_grant, reject, or revoke.
    • Cause
      • The new snippets rely on client.set_project('<YOUR_PROJECT_ID>'), but the OpenAPI contract for these OAuth2 operations still requires a method-level project_id path parameter, so the examples omit a required operation argument.
    • Fix
      • Update each OAuth2 Python server example to include project_id = '<PROJECT_ID>' in the SDK call, or update the generated SDK/spec contract if project_id is intended to be sourced from the configured client project rather than the method arguments.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "chore: update API specs and SDK examples" | Re-trigger Greptile

Comment on lines +11683 to 11691
"name": "resource",
"description": "RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.",
"required": false,
"schema": {
"type": "string",
"default": []
},
"in": "query"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Fix resource default

The new OAuth2 resource parameter is declared as a string, but its default is an array. Strict OpenAPI consumers and SDK generators can treat this optional string as the wrong type, producing invalid generated defaults or request builders for authorize/device/token flows. The same resource schema should use a string default, such as "", or be modeled as an array if multiple values are intended.

Artifacts

Repro: validation harness for OAuth2 resource default type mismatch

  • Contains supporting evidence from the run (text/javascript; charset=utf-8).

Stack trace captured during the T-Rex run

  • Keeps the raw stack trace available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment on lines +79904 to +79919
"metrics": {
"type": "array",
"description": "Aggregated groups ordered by time ascending.",
"description": "One entry per requested metric, each carrying its own points[] time series (sums per bucket \/ dimension over time).",
"items": {
"$ref": "#\/components\/schemas\/usageGroup"
"$ref": "#\/components\/schemas\/usageMetric"
},
"x-example": ""
}
},
"required": [
"metric",
"interval",
"groups"
"metrics"
],
"example": {
"metric": "executions",
"interval": "1d",
"groups": ""
"metrics": ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Use array examples

usageEventList.metrics is an array of usageMetric, but the schema example and x-example set it to an empty string. Generated docs and validators that check examples against schemas will see an invalid response shape, and SDK example generation can show metrics as a string instead of a list of metric series.

Artifacts

Repro: focused usageEventList metrics example validation script

  • Contains supporting evidence from the run (text/x-python; charset=utf-8).

Repro: validator output showing metrics array schema and string example mismatches

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment on lines +79931 to +79946
"metrics": {
"type": "array",
"description": "Aggregated groups ordered by time ascending. Each group carries the latest snapshot in its interval (argMax over time).",
"description": "One entry per requested metric, each carrying its own points[] time series (latest-snapshot per bucket \/ dimension via argMax over time).",
"items": {
"$ref": "#\/components\/schemas\/usageGroup"
"$ref": "#\/components\/schemas\/usageMetric"
},
"x-example": ""
}
},
"required": [
"metric",
"interval",
"groups"
"metrics"
],
"example": {
"metric": "files.storage",
"interval": "1d",
"groups": ""
"metrics": ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Use array examples

usageGaugeList.metrics is also declared as an array of usageMetric, but its example value is "". Any generated response examples or schema validation based on this spec can produce an invalid gauge response where callers see a string instead of the required metrics array.

Artifacts

Repro: focused usageGaugeList metrics example validator

  • Contains supporting evidence from the run (text/x-python; charset=utf-8).

Repro: validation output showing array schema and string examples

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex


const result = await usage.listEvents({
metric: '<METRIC>',
metrics: [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Pass a metric

The new API marks metrics[] as required with one to ten metric names, but this example passes an empty array. Copying it will send a request with no requested metrics, which can fail validation or return no useful data. The examples should use a one-element array, matching the spec text.

Suggested change
metrics: [],
metrics: ['executions'],

query {
usageListEvents(
metric: "<METRIC>",
metrics: [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Pass a metric

The usage endpoint requires one to ten metric names, but the GraphQL example passes metrics: []. A copied query asks for no series, so it can fail validation or return an empty result instead of demonstrating the new response shape.

Suggested change
metrics: [],
metrics: ["executions"],

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