ajv-validator / ajv-validator/ajv

vscode intellisense for prefixItems

Aperta
#2,265 0 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?**
version : 8.12.0

**Typescript code**

```typescript
interface Data {
hobbies: string[];
}

const schema: JSONSchemaType = {
type: "object",
properties: {
hobbies: {
type: "array",
uniqueItems: true,
prefiexItems: [
{ type: "string" },
{ type: "string" },
{ type: "string" },
{ type: "string" },
],
items: false,
},
},
};
```

**Typescript compiler error messages**

```
The types of 'properties.hobbies' are incompatible between these types.
Type '{ type: "array"; uniqueItems: true; prefiexItems: { type: string; }[]; items: boolean; }' is not assignable to type '{ $ref: string; } | (UncheckedJSONSchemaType & { nullable?: false | undefined; const?: string[] | undefined; enum?: readonly string[][] | undefined; default?: string[] | undefined; })'.
Types of property 'items' are incompatible.
Type 'boolean' is not assignable to type 'UncheckedJSONSchemaType'.ts(2322)
```

**Describe the change that should be made to address the issue?**
As from [NEW: draft 2020-12](https://ajv.js.org/json-schema.html#prefixitems) prefixItems is new addition and [additionalItems is not supported in JSON Schema draft-2020-12](https://ajv.js.org/json-schema.html#additionalitems) i want to disable additional items but vscode does not provide intellisense for `prefixItem`

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

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.