Open
Description
I am trying to validate a JSON configuration using typescript-json-schema
and ajv
.
I would like to add a description to every field in the schema. This works for every field, except the [env: string]
key, which is grabbing the comment that is written above the source code of PartialDeep<T>
(from type-fest
), instead of using the supplied description.
export type ConfigJson = {
/**
* Schema definition reference
*/
$schema: string;
/**
* Configuration per environment
*/
environments: {
/**
* Specific configuration for this environment
*/
[env: string]: PartialDeep<Config>;
};
/**
* Global configuration
*/
global: PartialDeep<Config>;
};
The schema comes out like this:
"definitions": {
"PartialObjectDeep<Config>": {
"...": "...",
"description": "Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.",
"...": "...",
},
"type": "object"
},
...
},
"properties": {
"...": "...",
"environments": {
"additionalProperties": {
"$ref": "#/definitions/PartialObjectDeep<Config>"
},
"description": "Configuration per environment",
"type": "object"
},
"...": "...",
},