superfaceai / cli

Let AI connect the APIs for you
https://superface.ai
MIT License
22 stars 4 forks source link

[BUG] Install command removes fields from super.json #100

Closed martinalbert closed 3 years ago

martinalbert commented 3 years ago

Description

install command removes retryPolicy, priority or providerFailover fields from super.json

Expected Behaviour

CLI shouldn't remove existing fields. After install is executed, super.json should be modified only on places where it should be modified, if new profile is installed, no other profile should be affected and if already existing profile is installed, his settings in super.json should be preserved.

Current Behaviour

Currently install modifies whole super.json document and removes mentioned fields. This behaviour is not occurring only when using sf install without specifying profile or force flag.

Possible Solution

Update mutate module for super.json to work with new superjson schema.

Steps to Reproduce

  1. create Superface project
  2. install profile
  3. set up retry policy
  4. install another profile
Jakub-Vacek commented 3 years ago

This issue was actually problem in SDK - it is fixed now. So in CLI we just need to use not beta version of SDK (when it will be released).

martinalbert commented 3 years ago

EDIT:

I was using incorrect structure of super.json, mutation works correctly 👍🏻

cli version:

@superfaceai/cli/0.0.19 darwin-x64 node-v15.4.0 (with @superfaceai/one-sdk@0.0.29-beta.4+91971d72, @superfaceai/parser@0.0.17)

testing configure command

sf configure mock -p starwars/character-information