Skip to content
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

API management #53

Open
ilveroluca opened this issue Jul 7, 2021 · 2 comments
Open

API management #53

ilveroluca opened this issue Jul 7, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ilveroluca
Copy link

It would be handy to have additional API management functionality. Currently, only the api configure subcommand is available. Useful additions would be:

  • api delete
  • api show
@danielgtaylor danielgtaylor added enhancement New feature or request help wanted Extra attention is needed labels Sep 15, 2021
@lalmeras
Copy link
Contributor

It appears that show command is implemented in 0.17.0.

I look into delete implementation, and it cannot be implemented simply as viper is used to manage configuration and does not support configuration key unset: see spf13/viper#632. As viper issue does not seem to be updated for a long time, the most straightforward solution is to perform deletion with a custom json unmarshal/marshal call.

@lalmeras
Copy link
Contributor

Here is a basic implementation using json.MarshallIndent. Not sure it is the better way to perform this as it updates configuration file outside viper API, but as highlighted sooner viper override-based behavior is not compatible with configuration key removal.

https://github.com/danielgtaylor/restish/compare/main...lalmeras:restish:command-api-delete?expand=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants