-
Notifications
You must be signed in to change notification settings - Fork 1.3k
move Stainless compatibility transforms from gen-openapi.ts into stainless.yml #1563
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?
move Stainless compatibility transforms from gen-openapi.ts into stainless.yml #1563
Conversation
…api.ts into stainless.yml
|
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ stagehand-java studio · code · diff
✅ stagehand-openapi studio · code · diff
✅ stagehand-kotlin studio · code · diff
✅ stagehand-typescript studio · code · diff
✅ stagehand-php studio · code · diff
✅ stagehand-csharp studio · code · diff
✅ stagehand-go studio · code · diff
✅ stagehand-python studio · conflict
✅ stagehand-ruby studio · conflict
✅ stagehand-cli studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryRefactored OpenAPI post-processing from string-based regex transformations in gen-openapi.ts to declarative JSONPath-based transforms in stainless.yml. This keeps
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Script as gen-openapi.ts
participant Fastify as Fastify/Zod
participant YAML as openapi.v3.yaml
participant Stainless as Stainless SDK Gen
participant SDK as Generated SDK
Dev->>Script: Run npm run gen-openapi
Script->>Fastify: Generate OpenAPI spec
Fastify->>YAML: Output raw schema (with propertyNames, additionalProperties: {})
Note over YAML: Raw Fastify+Zod output<br/>(faithful to source)
Dev->>Stainless: Run SDK generation
Stainless->>YAML: Read openapi.v3.yaml
Stainless->>Stainless: Apply transforms from stainless.yml
Note over Stainless: Remove propertyNames<br/>Set additionalProperties: true<br/>Add ProxyConfigList title
Stainless->>SDK: Generate type-safe SDK
Note over Script,SDK: Before: Script did string replacements<br/>After: Stainless applies transforms
|
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.
No issues found across 5 files
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.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="stainless.yml">
<violation number="1" location="stainless.yml:8">
P2: The new top-level `openapi` block duplicates an existing `openapi` section later in the file, so YAML will overwrite the earlier `code_samples` setting. Merge `code_samples: mintlify` into the existing `openapi` block to avoid losing the config.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| // 4. Fix StreamEventSystemData*.result to have x-stainless-any: true | ||
| yaml = yaml.replace( | ||
| /(StreamEventSystemData(?:Output)?:\s+type: object\s+properties:\s+status:[\s\S]+?)(result:\s+description: [^\n]+)\n(\s+error:)/g, | ||
| "$1$2\n x-stainless-any: true\n$3", | ||
| ); |
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.
looks like this is missing in the final transforms
why
Better to have in stainless yaml than gen-openapi script + some minor cleanup.
what changed
test plan
Summary by cubic
Moved Stainless compatibility transforms from gen-openapi.ts into stainless.yml and removed the v2 string model config. This keeps openapi.v3.yaml faithful to the Fastify/Zod output and applies compatibility at SDK generation, improving CI stability and supporting STG-1149.
Written for commit 6cabbd3. Summary will update on new commits.