I'm using json-schema-to-typescript and would like to specify an array of strings.
Currently, I have the following:
"type": "object",
"description": "...",
"additionalProperties": true,
"items": {
"type": "string"
}
When converted to TS, it returns [k: string]: unknown;
I'd like for it to return [k: string]: string;
instead.
Thanks in advance
CodePudding user response:
items
is an array keyword, but you have specified "type": "object"
. Have you tried changing that to "type": "array"
and removing additionalProperties
?
CodePudding user response:
I did it by removing the items
property and changing to "additionalProperties": { "type": "string" }