Currently, the docs.sort option in the CLI accepts a string for determining the sort order, e.g. "access, scope".
However, it's much easier to parse, validate, provide type-safety, and offer auto-completion in the IDE when the expected type is an array of enumerated valid strings.
"sort": {
"type": "string",
"description": "A comma-separated string of properties to sort by. Valid properties are: “access”, “scope”, “type” and “name”."
}
Not sure what the deprecation policies are at this young stage of the project, but it wouldn't be difficult to support both for a while and print a warning that the string syntax will be removed in the next major version.
Currently, the
docs.sort
option in the CLI accepts a string for determining the sort order, e.g."access, scope"
.However, it's much easier to parse, validate, provide type-safety, and offer auto-completion in the IDE when the expected type is an array of enumerated valid strings.
In TypeScript (not sure about Flow):
instead of
In JSON schema:
instead of
Not sure what the deprecation policies are at this young stage of the project, but it wouldn't be difficult to support both for a while and print a warning that the string syntax will be removed in the next major version.