feat: Add support for date-time format
An implementation of JSON Schema in Swift. Supporting JSON Schema Draft 4, 6, 7, 2019-09, 2020-12.
The JSON Schema 2019-09 and 2020-12 support are incomplete and have gaps with some of the newer keywords.
JSONSchema.swift does not support remote referencing #9.
JSONSchema can be installed via CocoaPods.
pod 'JSONSchema'
import JSONSchema try JSONSchema.validate(["name": "Eggs", "price": 34.99], schema: [ "type": "object", "properties": [ "name": ["type": "string"], "price": ["type": "number"], ], "required": ["name"], ])
Validate returns an enumeration ValidationResult which contains all validation errors.
ValidationResult
print(try validate(["price": 34.99], schema: ["required": ["name"]]).errors) >>> "Required property 'name' is missing."
JSONSchema is licensed under the BSD license. See LICENSE for more info.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
JSON Schema
An implementation of JSON Schema in Swift. Supporting JSON Schema Draft 4, 6, 7, 2019-09, 2020-12.
The JSON Schema 2019-09 and 2020-12 support are incomplete and have gaps with some of the newer keywords.
JSONSchema.swift does not support remote referencing #9.
Installation
JSONSchema can be installed via CocoaPods.
Usage
Error handling
Validate returns an enumeration
ValidationResult
which contains all validation errors.License
JSONSchema is licensed under the BSD license. See LICENSE for more info.