docs should check that category ids match the specified version #497
Labels
API
Underlying issue is with the ReadMe API and not necessarily the `rdme` client itself
bug
Something isn't working
command:docs
Issues pertaining to the `docs`, `changelogs`, or `custompages` commands
Background
Mac OSX 12.2.1
7.2.0
Symptom
Running
rdme docs ./folder --key <key> --version <version>
where the category ids in the YAML Front Matter Blocks are for a different version than the one specified on the command line returns a confusing error:Expected Behavior
Instead of returning a "page slug must be unique" error, the
rdme
CLI should check the category ids in the Front Matter Blocks against those returned by the/categories
API for the version specified to therdme docs
command and return a "category not found for this version" error.Steps to Reproduce
rdme docs ... --version <different version id>
for a different version id then the one chosen in step (2).Worst Case
Also, if as a user you take the error message at its word (as I did) and change the page slug to be unique, then you get a really bad outcome. The category id in the YAML Front Matter block wins out over the version specified on the command line and the
rdme docs
command will update the version associated with the category id. This is very unexpected and in my case updated the "stable" version of my docs, duplicating all of the documents with new slugs.The text was updated successfully, but these errors were encountered: