ajv-validator / ajv-validator/ajv
deepPatternProperties & deepPatternRequired & uniquePatternProperties
- Lenguaje dominante
- TypeScript
- Estrellas
- 14.8k
- Forks
- 1k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
We would like to start by saying how expansive @epoberezkin effort is in helping people who are new to **AJV**, thank you for your record of answers here on **GitHub** and on **StackOverflow**, they are instrumental to our understanding of **AJV**.
On **AJV** version: 8.20.0, we are trying to target **enumerated object keys** with **wildcard pointers**, reasons could include imported/converted **XSD** schemas where **XML** tags can have the same name and not be nested (**JSON** can't have duplicates), or just the case where enumerated keys are just needed. Using a combination of **deepPatternProperties** (conceptual child of **deepProperties**) and **patternProperties**, provides a way to target validations throughout the schema. Similar to "uniqueProperties" we added "uniquePatternProperties".
We provide the **GIST** for your consideration:
[deepPatternProperties.js ](https://gist.github.com/VivaRado/5b1a306403d1e253eaa47f988ed77ca0)
[deepPatternRequired.js ](https://gist.github.com/VivaRado/72df11f9af7f0aefa5fcf9f79e5b5c7a)
[uniquePatternProperties.js](https://gist.github.com/VivaRado/1f163e90e0939bf5688a288e1b00d07c)
We assume more knowledgeable maintainers will be more elegant in their solutions!
Thank you!
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.