ajv-validator / ajv-validator/ajv

jtd key value resolves to never

未關閉
#2,169 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
typescript
主要語言
TypeScript
星號
14.8k
分支
1k
PR 合併指標
30 天內沒有已合併 PR

描述

**What version of Ajv are you using? Does the issue happen if you use the latest version?**

8.11.2

**Your typescript code**

```ts
import Ajv, {JTDSchemaType} from 'ajv/dist/jtd';
export interface N8nAssetsNodeData {
displayName:string;
icon:string;
install:string;
query: {
[key:string]: string;
}
}

export interface N8nAssetsData {
[key: string]: N8nAssetsNodeData;
}

const schemaAssetsData:JTDSchemaType = {
values: {
properties: {
displayName: {
type: 'string',
},
icon: {
type: 'string',
},
install: {
type: 'string',
},
query: {
values: {
type: 'string'
},
},
},
additionalProperties: true
}
};
```

**Typescript compiler error messages**

```
error TS2322: Type '{ values: { properties: { displayName: { type: string; }; icon: { type: string; }; install: { type: string; }; query: { values: { type: string; }; }; }; additionalProperties: boolean; }; }' is not assignable to type 'never'.

22 const schemaAssetsData:JTDSchemaType = {
```

**Describe the change that should be made to address the issue?**

A way to generate typescript key value maps in jtd without it being resolved to "never".

**Are you going to resolve the issue?**

If I had the clue, yes. But unfortunately I have no plan.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。