ajv-validator / ajv-validator/ajv

Migration from v6 to v8: ValidationError isn't exposed anymore

Aperta
#1,832 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
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?**

I was using 6, I wanted to migrate to 8.

**Ajv options object**

N/A

**JSON Schema**

N/A

**Your code**

In v6 I could write code like:

```typescript
import {ValidationError} from 'ajv';
function formatAjvError(error: ValidationError): CustomErrorDto {}
```

In v8 I must write:
```typescript
import Ajv from 'ajv';
function formatAjvError(error: InstanceType): CustomErrorDto {}
```

This is unnecessary verbose.

**What results did you expect?**

`ValidationError` is directly exported from `ajv` module.

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

Yes, I can make PR for that.

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.