ajv-validator / ajv-validator/ajv

jtd key value resolves to never

Aperta
#2,169 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
typescript
Lingua principale
TypeScript
Stelle
14.8k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.