Skip to content

Commit

Permalink
Merge pull request #6 from hckrnews/feature/first-draft
Browse files Browse the repository at this point in the history
Add AJV formats
  • Loading branch information
w3nl authored Nov 21, 2023
2 parents bdbe402 + 7b6dacb commit fa447f8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
23 changes: 20 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hckrnews/openapi-model",
"description": "OpenAPI Model",
"version": "0.2.1",
"version": "0.2.2",
"author": {
"name": "Pieter Wigboldus",
"url": "https://hckr.news/"
Expand Down Expand Up @@ -53,7 +53,8 @@
"ajv"
],
"dependencies": {
"ajv": "^8.12.0"
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1"
},
"funding": {
"type": "github",
Expand Down
2 changes: 2 additions & 0 deletions src/model.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Ajv from 'ajv'
import addFormats from 'ajv-formats'
const ajv = new Ajv({
strict: false
})
addFormats(ajv, ['date', 'time', 'uri', 'uuid', 'email', 'hostname', 'regex'])

/**
* @typedef {import('./schema.d.ts').OpenAPIV3.BaseSchemaObject} BaseSchemaObject
Expand Down

0 comments on commit fa447f8

Please sign in to comment.