Skip to content

Conversation

@richard-hajek
Copy link

Addresses #239

Fair warning, this work is vibe coded. However I tested it and It Works On My Machine ™️

@richard-hajek
Copy link
Author

richard-hajek commented Nov 10, 2025

I already noticed few issues

  • random crashes on profile selection with unknown profile
  • what in this scenario is restish edit supposed to do?

I do not recommend to merge this at this stage

…e validation

- Load all .restish.json/.restish.yaml files from current directory up to root
- Deep merge API configs and profiles across multiple files (headers, query params, etc.)
- Replace panic() calls with graceful error handling showing available profiles
- Add interactive menu to choose which config file to save when editing
- Track all config sources for each API to enable proper save targeting
- By default, save to the closest (most specific) config file

This enables hierarchical config organization (e.g., project root + team + developer
overrides) while maintaining a smooth editing experience with restish apis edit.

Fixes issues with random crashes on invalid profile selection and clarifies the
behavior of local config editing.
@richard-hajek
Copy link
Author

I believe i fixed most of the issues in this PR

@jaynis
Copy link

jaynis commented Jan 14, 2026

Hi. I was looking for this feature and tried out your PR and have a few remarks:

  • Reading a API configuration from a specified config file seems to work fine
  • Updating a API which is present in a specified config file seems to work as well
  • Adding new APIs when a config file is specified does not work reliably. APIs are still added to the default file and in addition to that the entire content of the specified config file is merged into the central file - something I would definitely not expect.
  • When the specified config file does not exist, restish silently falls back to the default configuration file. In this case I would either create the specified config file or at least throw an error.
  • When there is a API in the default config file with a certain URL and the specified config file contains a API with a different name, but the same URL (something which can very well happen), restish panics with panic: multiple APIs configured with the same base URL: <url>

Generally, I would advise against doing any merging of config files. If a custom config file is specified with --rsh-config or RSH_CONFIG this should be the single source of truth, overriding the default config file entirely in every regard.

@richard-hajek
Copy link
Author

Thanks for the review! I don't use restish as frequently right now, so it's not a high priority for me, but I'll try to get to it at some point

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.

2 participants