ajv-validator / ajv-validator/ajv

vscode intellisense for prefixItems

Offen
#2,265 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
typescript
Vorherrschende Sprache
TypeScript
Sterne
14.8k
Forks
1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.