• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    Dart
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OvO is a Dart-first schema declaration and validation library.

OvO

OvO is a Dart-first schema declaration and validation library.

Introduction

OvO is a Dart-first schema declaration and validation library. We use the technical term "Schema" to define any data type, from simple single data (for example: string/int, etc.) to complex nested Map.

OvO is designed to be as user-friendly and developer-friendly as possible, with the goal of eliminating tedious type checking and object deserialization. It is easy to compose complex data structure validation using simple declaration validation.

several important aspects

  • A fun walkthrough of Dart type extensions
  • Simple and chained interface calls
  • Can be used on any Dart platform (Dart, Web, Flutter)

Installation

We are more aggressive and use higher versions of Dart stable versions as much as possible.

Install from command line

dart pub add ovo

Install from pubspec.yaml

dependencies:
  ovo: latest

Basic Usage

Create a simple string schema:

import 'package:ovo/ovo.dart' as ovo;

// Create a schema for string.
final schema = ovo.string();

// Parsing
await schema.parse('Hello World'); // => 'Hello World'
await schema.parse(123); // => throws OvoError

// Safe parsing, don't throw error.
await schema.safeParse('Hello World'); // => OvoSuccess<String>('Hello World')
await schema.safeParse(123); // => OvoFailure<String>('Expected a string, but received a int')

Creating an JSON schema:

import 'package:ovo/ovo.dart' as ovo;

final schema = ovo.json({
    'name': ovo.string(),
});

await schema.parse({
    'name': 'John',
}); // => {'name': 'John'}

More Repositories

1

prisma-dart

Prisma Client Dart is an auto-generated type-safe ORM. It uses Prisma Engine as the data access layer and is as consistent as possible with the Prisma Client JS/TS APIs.
Dart
448
star
2

cors

🔮Supported(Laravel/Lumen/PSR-15/Swoft/Slim/ThinkPHP) - PHP CORS (Cross-origin resource sharing) middleware.
PHP
274
star
3

id-card-of-china

🆔一个基于「公民身份号码」规则获取身份证号码中包含的基础信息组件(PHP)
PHP
175
star
4

gbt2260

🇨🇳中华人民共和国国家标准 GB/T 2260 行政区划代码
kvlang
105
star
5

laravel-jpush-notification-channel

Jpush notification channel for Laravel 5.5+ / 极光推送 Laravel 驱动
PHP
44
star
6

spry

Spry -A lightweight, composable Dart web framework designed to work collaboratively with various runtime platforms.
Dart
30
star
7

id-card-of-china-js

一个基于「公民身份身份号码」规则获取身份证号码中包含的基础信息组件(JS)
TypeScript
28
star
8

webpack-laravel-mix-manifest

🐶A webpack plugin that generates Laravel framework compatible mix-manifest.josn file.
TypeScript
26
star
9

prisma-library

Bind the Prisma ORM query engine to any programming language you like ❤️
Rust
20
star
10

napi-dart

Dart
14
star
11

numeral.dart

A Dart library for Format number into beautiful string, Format the number into a beautiful, readable and short string.
Dart
10
star
12

qq-emoicon

目前最新的QQ表情资源。
PHP
10
star
13

oss-stream-wrapper

Aliyun OSS support streamWrapper. (&Aliyun OSS SDK for PHP.) 支持OSS自定义流协议操作。
PHP
7
star
14

webfetch

A Dart implementation of the Web Fetch API that allows you to make requests and process results just like using fetch in a browser.
Dart
7
star
15

emoji-format

原生emoji表情格式化为base64代码和反解析为emoji工具
PHP
5
star
16

gib

📝Blog creation using GitHub issues, built by Vue.js
JavaScript
5
star
17

routingkit

🛸 Routing Kit - Lightweight and fast router for Dart.
Dart
4
star
18

thinksns-installer

The ThinkSNS-Installer is ThinkSNS 4 version installed library.
PHP
3
star
19

geohash

Longitude and Latitude Geo Hash Library.
PHP
3
star
20

stream-wrapper-interface

Common interface for streamWrapper class.
PHP
2
star
21

laravel-tencent-cloud-sms-notification-channel

腾讯云短信通知驱动
PHP
2
star
22

aliyun-oss

Aliyun OSS SDK for PHP. (&Support streamWrapper) 支持自定义流协议操作。
PHP
1
star
23

composer-vendor-install-folders

Allows components custom folders installed.
PHP
1
star
24

medz

Seven's profile website
TypeScript
1
star
25

create-order-length-php

PHP
1
star
26

public

Seven's public files.
TypeScript
1
star
27

consolekit

$ Console Kit is a tool for creating interactive CLI applications.
Dart
1
star
28

oh

Dart
1
star
29

blog-server-with-dart

Binding a REST of Blog with Dart (Spry + Prisma)
Dart
1
star