-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(cli): prompting the user to use info.title
for their installed SDK
#763
Conversation
packages/api/src/commands/install.ts
Outdated
// If they don't like what we picked from the spec info doc then let's have them tell us | ||
// what they want. | ||
({ value: identifier } = await promptForIdentifier(false)); | ||
} | ||
} else { |
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.
We should never get to this else
case because info.title
is required in an OpenAPI definition but just in case we don't have it for whatever reason, we'll just fallback to asking them what they want -- though codegen will likely fail immediately after this because of their invalid spec.
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.
The changes look good but I was thinking we do this with a different prompt flow where we prompt the user for the identifier, but rather than having two questions to handle this, we have one question (i.e., 'What would you like to identify this API as?') with the initial value set to the slugified info.title
field. This would be spiritually similar to how we have a sensible initial value when reducing a spec file in rdme
:
Let me know what you think! I like how it's fewer prompts/keypresses with my idea, but I do like the explicitness of your approach
Co-authored-by: Kanad Gupta <8854718+kanadgupta@users.noreply.github.com>
🧰 Changes
This slightly changes the installation process to now prompt the user if they would like to install their SDK using the
info.title
value from the API definition they supplied:Note that this work only applies if they supply a non-ReadMe API Registry value to
npx api install
: