Skip to content

Conversation

@Ryan-Amirthan
Copy link
Contributor

Description

Link to Devin run: https://app.devin.ai/sessions/aae6845f5c3c457d93437d7748ee7a23
Requested by: ryanstep@buildwithfern.com (@Ryan-Amirthan)

Fixes three bugs in fern overrides write that prevented existing overrides from being merged when regenerating:

  1. Typo in paths key: Was checking for "path" (singular) instead of "paths" (plural), causing existing path overrides to be ignored
  2. Wrong schema location: Was reading schemas from existingOverrides.path instead of existingOverrides.components.schemas
  3. Wrong output path: Was always deriving output filename from the spec file (e.g., openapi.jsonopenapi-overrides.json) instead of writing back to the configured overrides file

Changes Made

  • Fixed paths key check from "path" to "paths" to match OpenAPI spec structure
  • Fixed schemas reading to use existingOverrides.components?.schemas instead of existingOverrides.path
  • When an overrides file is configured in generators.yml, now writes back to that same path
  • When no overrides file is configured, defaults to .yml extension (not the spec's extension)

Testing

  • Unit tests added/updated
  • Manual testing completed (lint checks pass)

Human Review Checklist

  • Verify the key names (paths, components.schemas) match standard OpenAPI override file structure
  • Consider whether the existing e2e test at packages/cli/ete-tests/src/tests/write-overrides/writeOverrides.test.ts should be updated to cover the merge scenario
…rides

Co-Authored-By: ryanstep@buildwithfern.com <ryanstep@umich.edu>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants