SlideShare une entreprise Scribd logo
1  sur  52
Télécharger pour lire hors ligne


1 {
2 "name": "pirosikick"
3 "age": 28,
4 "email": "pirosikick@example.com"
5 }
1 {
2 "type": "object",
3 "properties": {
4 "name": { "type": "string" },
5 "age": {
6 "type": "integer",
7 "minimum": 0
8 },
9 "email": {
10 "type": "string",
11 "format": "email"
12 }
13 }
14 }
1 {
2 "$schema": "http://json-schema.org/draft-04/schema#",
3 "$id": "http://example.com/schema.json#",
4 "type": "object",
5 "definitions": {
6 "name": { ... },
7 "age": { ... },
8 "email": { ... },
9 },
10 "properties": {
11 "name": {
12 "$ref": "#/definitions/name"
13 },
14 "age": {
15 "$ref": "#/definitions/age"
16 },
17 "email": {
18 "$ref": "#/definitions/email"
19 }
20 }
21 }
1 {
2 "$schema": "http://json-schema.org/draft-04/schema#",
3 "$id": "http://example.com/schema.json#",
4 "type": "object",
5 "definitions": {
6 "name": { ... },
7 "age": { ... },
8 "email": { ... },
9 },
10 "properties": {
11 "name": {
12 "$ref": "#/definitions/name"
13 },
14 "age": {
15 "$ref": "#/definitions/age"
16 },
17 "email": {
18 "$ref": "#/definitions/email"
19 }
20 }
21 }
1 {
2 "$schema": "http://json-schema.org/draft-04/schema#",
3 "$id": "http://example.com/schema.json#",
4 "type": "object",
5 "definitions": {
6 "name": { ... },
7 "age": { ... },
8 "email": { ... },
9 },
10 "properties": {
11 "name": {
12 "$ref": "#/definitions/name"
13 },
14 "age": {
15 "$ref": "#/definitions/age"
16 },
17 "email": {
18 "$ref": "#/definitions/email"
19 }
20 }
21 }
1 {
2 "$schema": "http://json-schema.org/draft-04/schema#",
3 "$id": "http://example.com/schema.json#",
4 "type": "object",
5 "definitions": {
6 "name": { ... },
7 "age": { ... },
8 "email": { ... },
9 },
10 "properties": {
11 "name": {
12 "$ref": "#/definitions/name"
13 },
14 "age": {
15 "$ref": "#/definitions/age"
16 },
17 "email": {
18 "$ref": "#/definitions/email"
19 }
20 }
21 }
1 {
2 "$schema": "http://json-schema.org/draft-04/schema#",
3 "$id": "http://example.com/schema.json#",
4 "type": "object",
5 "definitions": {
6 "name": { ... },
7 "age": { ... },
8 "email": { ... },
9 },
10 "properties": {
11 "name": {
12 "$ref": "#/definitions/name"
13 },
14 "age": {
15 "$ref": "#/definitions/age"
16 },
17 "email": {
18 "$ref": "#/definitions/email"
19 }
20 }
21 }
1 {
2 "$schema": "http://json-schema.org/draft-04/hyper-schema",
3 "type": "object",
4 "definitions": { ... },
5 "properties": { ... },
6 "links": [{
7 "title": "ユーザ取得",
8 "description": "idに紐づくユーザを返す",
9 "href": "/user/:id",
10 "method": "GET",
11 "rel": "self"
12 }, {
13 "title": "ユーザ新規登録",
14 "description": "idに紐づくユーザを返す",
15 "href": "/user",
16 "method": "POST",
17 "rel": "create",
18 "schema": {
19 "type": "object",
20 "properties": { ... }
21 }
22 }]
23 }
1 {
2 "$schema": "http://json-schema.org/draft-04/hyper-schema",
3 "type": "object",
4 "definitions": { ... },
5 "properties": { ... },
6 "links": [{
7 "title": "ユーザ取得",
8 "description": "idに紐づくユーザを返す",
9 "href": "/user/:id",
10 "method": "GET",
11 "rel": "self"
12 }, {
13 "title": "ユーザ新規登録",
14 "description": "idに紐づくユーザを返す",
15 "href": "/user",
16 "method": "POST",
17 "rel": "create",
18 "schema": {
19 "type": "object",
20 "properties": { ... }
21 }
22 }]
23 }
1 {
2 "$schema": "http://json-schema.org/draft-04/hyper-schema",
3 "type": "object",
4 "definitions": { ... },
5 "properties": { ... },
6 "links": [{
7 "title": "ユーザ取得",
8 "description": "idに紐づくユーザを返す",
9 "href": "/user/:id",
10 "method": "GET",
11 "rel": "self"
12 }, {
13 "title": "ユーザ新規登録",
14 "description": "idに紐づくユーザを返す",
15 "href": "/user",
16 "method": "POST",
17 "rel": "create",
18 "schema": {
19 "type": "object",
20 "properties": { ... }
21 }
22 }]
23 }
1 #!/bin/bash
2 # vim: set background=light nolist nonumber:
3
4 # 雛形を生成
5 # - schemata以下にリソース毎にファイルを生成
6 # - JSONとYAMLで書くことが出来る(--yamlでYAML)
7 prmd init --yaml user > schemata/user.yaml
8
9 # JSON Hyper-Schema(schema.json)の生成
10 # - ./schemata/*.{yaml,json}とmeta.jsonを結合して生成する
11 prmd combine -m meta.json ./schemata > schema.json
12
13 # Markdownの生成
14 # - prmd combineで生成したschema.jsonからREADME.mdを生成
15 # - OVERVIEW.mdを出力ファイルの先頭に挿入
16 prmd doc --prepend OVERVIEW.md schema.json > README.md
1 const schema = {
2 "type": "object",
3 "properties": {
4 "name": {
5 "title": "名前",
6 "type": "string"
7 },
8 "email": {
9 "title": "メールアドレス",
10 "type": "string",
11 "format": "email"
12 }
13 }
14 };
1 import React from 'react';
2 import { render } from 'react-dom';
3 import Form from 'react-jsonschema-form';
4
5 const schema = { ... };
6
7 render(
8 <Form
9 schema={schema}
10 onChange={({ formData }) => { ... }}
11 onSubmit={({ formData }) => { ... }}
12 />,
13 document.getElementById('wrapper')
14 );
1 const uiSchema = {
2 "name": {
3 "classNames": "from__name", // カスタムクラス名
4 "ui:placeholder": "全角で頼む" // プレースホルダー
5 },
6 "email": {
7 "classNames": "from__email",
8 "ui:placeholder": "you@example.com"
9 }
10 };
11
12 render(
13 <Form
14 schema={schema}
15 uiSchema={uiSchema}
16 onChange={({ formData }) => { ... }}
17 onSubmit={({ formData }) => { ... }}
18 />,
19 document.getElementById('wrapper')
20 );
1 const uiSchema = {
2 "name": {
3 // カスタムフィールド
4 "ui:field": CustomeField,
5 },
6 "email" :{
7 // カスタムウィジェット
8 "ui:widget": CustomeWidget,
9 }
10 };






JSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE

Contenu connexe

Tendances

PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applicationselliando dias
 
TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !Matheus Marabesi
 
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway ichikaway
 
Perl6 operators and metaoperators
Perl6   operators and metaoperatorsPerl6   operators and metaoperators
Perl6 operators and metaoperatorsSimon Proctor
 
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)Matthew Beale
 
Forbes MongoNYC 2011
Forbes MongoNYC 2011Forbes MongoNYC 2011
Forbes MongoNYC 2011djdunlop
 
Rails GUI Development with Ext JS
Rails GUI Development with Ext JSRails GUI Development with Ext JS
Rails GUI Development with Ext JSMartin Rehfeld
 
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享elevenma
 
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com PhingDarkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com PhingMatheus Marabesi
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genMongoDB
 
PerlでWeb API入門
PerlでWeb API入門PerlでWeb API入門
PerlでWeb API入門Yusuke Wada
 
Pemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan SessionPemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan SessionNur Fadli Utomo
 

Tendances (20)

Wsomdp
WsomdpWsomdp
Wsomdp
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
 
Xmpp prebind
Xmpp prebindXmpp prebind
Xmpp prebind
 
TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !
 
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
 
Perl6 operators and metaoperators
Perl6   operators and metaoperatorsPerl6   operators and metaoperators
Perl6 operators and metaoperators
 
DOS
DOSDOS
DOS
 
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
 
Forbes MongoNYC 2011
Forbes MongoNYC 2011Forbes MongoNYC 2011
Forbes MongoNYC 2011
 
Rails GUI Development with Ext JS
Rails GUI Development with Ext JSRails GUI Development with Ext JS
Rails GUI Development with Ext JS
 
Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01
 
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享20th.陈晓鸣 百度海量日志分析架构及处理经验分享
20th.陈晓鸣 百度海量日志分析架构及处理经验分享
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Yql && Raphaël
Yql && RaphaëlYql && Raphaël
Yql && Raphaël
 
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com PhingDarkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10gen
 
Coding website
Coding websiteCoding website
Coding website
 
PerlでWeb API入門
PerlでWeb API入門PerlでWeb API入門
PerlでWeb API入門
 
Pemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan SessionPemrograman Web 9 - Input Form DB dan Session
Pemrograman Web 9 - Input Form DB dan Session
 
TerminalでTwitter
TerminalでTwitterTerminalでTwitter
TerminalでTwitter
 

En vedette

Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜
Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜
Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜Akira Kuratani
 
ReactとSeleniumの幸せな関係
ReactとSeleniumの幸せな関係ReactとSeleniumの幸せな関係
ReactとSeleniumの幸せな関係Akira Kuratani
 
サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事Hiroyuki Hiki
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiYukiya Nakagawa
 
先入観とバイアスを考慮したWebサイトパフォーマンス改善
先入観とバイアスを考慮したWebサイトパフォーマンス改善先入観とバイアスを考慮したWebサイトパフォーマンス改善
先入観とバイアスを考慮したWebサイトパフォーマンス改善Yoichiro Takehora
 
How to make GAE adapt the Great Firewall
How to make GAE adapt the Great FirewallHow to make GAE adapt the Great Firewall
How to make GAE adapt the Great FirewallHayato Yoshikawa
 
PYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミングPYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミングryos36
 
PYNQで○○してみた!
PYNQで○○してみた!PYNQで○○してみた!
PYNQで○○してみた!aster_ism
 
Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出marsee101
 
ハイレベルメンバーによる共創実験 / UX & Service Sketch #26
ハイレベルメンバーによる共創実験 / UX & Service Sketch #26ハイレベルメンバーによる共創実験 / UX & Service Sketch #26
ハイレベルメンバーによる共創実験 / UX & Service Sketch #26Keita Takizawa
 
Namespace API を用いたマルチテナント型 Web アプリの実践
Namespace API を用いたマルチテナント型 Web アプリの実践Namespace API を用いたマルチテナント型 Web アプリの実践
Namespace API を用いたマルチテナント型 Web アプリの実践Takuya Ueda
 

En vedette (20)

Studyx2
Studyx2Studyx2
Studyx2
 
Studyx1
Studyx1Studyx1
Studyx1
 
Studyx5
Studyx5Studyx5
Studyx5
 
Java勉強会2017.3.17
Java勉強会2017.3.17Java勉強会2017.3.17
Java勉強会2017.3.17
 
Studyx4
Studyx4Studyx4
Studyx4
 
Studyx3
Studyx3Studyx3
Studyx3
 
Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜
Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜
Tokyo Salesforce DG Meetup 2017新年会〜Advent Calendarふりかえり〜
 
ReactとSeleniumの幸せな関係
ReactとSeleniumの幸せな関係ReactとSeleniumの幸せな関係
ReactとSeleniumの幸せな関係
 
サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事サーバーレスでシステムを開発する時に⼤切な事
サーバーレスでシステムを開発する時に⼤切な事
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
 
WebWorker and Atomics
WebWorker and AtomicsWebWorker and Atomics
WebWorker and Atomics
 
先入観とバイアスを考慮したWebサイトパフォーマンス改善
先入観とバイアスを考慮したWebサイトパフォーマンス改善先入観とバイアスを考慮したWebサイトパフォーマンス改善
先入観とバイアスを考慮したWebサイトパフォーマンス改善
 
How to make GAE adapt the Great Firewall
How to make GAE adapt the Great FirewallHow to make GAE adapt the Great Firewall
How to make GAE adapt the Great Firewall
 
PYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミングPYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミング
 
PYNQで○○してみた!
PYNQで○○してみた!PYNQで○○してみた!
PYNQで○○してみた!
 
PYNQ祭り
PYNQ祭りPYNQ祭り
PYNQ祭り
 
Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出Pynqでカメラ画像をリアルタイムfastx コーナー検出
Pynqでカメラ画像をリアルタイムfastx コーナー検出
 
Pynq祭り資料
Pynq祭り資料Pynq祭り資料
Pynq祭り資料
 
ハイレベルメンバーによる共創実験 / UX & Service Sketch #26
ハイレベルメンバーによる共創実験 / UX & Service Sketch #26ハイレベルメンバーによる共創実験 / UX & Service Sketch #26
ハイレベルメンバーによる共創実験 / UX & Service Sketch #26
 
Namespace API を用いたマルチテナント型 Web アプリの実践
Namespace API を用いたマルチテナント型 Web アプリの実践Namespace API を用いたマルチテナント型 Web アプリの実践
Namespace API を用いたマルチテナント型 Web アプリの実践
 

Similaire à JSON Schema in Web Frontend #insideFE

Agile Testing Days 2018 - API Fundamentals - postman collection
Agile Testing Days 2018 - API Fundamentals - postman collectionAgile Testing Days 2018 - API Fundamentals - postman collection
Agile Testing Days 2018 - API Fundamentals - postman collectionJoEllen Carter
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformationArnaud Porterie
 
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...Markus Lanthaler
 
Elasticsearch for SQL Users
Elasticsearch for SQL UsersElasticsearch for SQL Users
Elasticsearch for SQL UsersAll Things Open
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!Boy Baukema
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDbsliimohara
 
LF_APIStrat17_Embracing JSON Schema
LF_APIStrat17_Embracing JSON SchemaLF_APIStrat17_Embracing JSON Schema
LF_APIStrat17_Embracing JSON SchemaLF_APIStrat
 
AST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptIngvar Stepanyan
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用LearningTech
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3André Wuttig
 
Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018Izzi Smith
 
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27Ruby Meditation
 
Introduction to MongoDB for C# developers
Introduction to MongoDB for C# developersIntroduction to MongoDB for C# developers
Introduction to MongoDB for C# developersTaras Romanyk
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑Pokai Chang
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
d3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlind3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in BerlinToshiaki Katayama
 

Similaire à JSON Schema in Web Frontend #insideFE (20)

Agile Testing Days 2018 - API Fundamentals - postman collection
Agile Testing Days 2018 - API Fundamentals - postman collectionAgile Testing Days 2018 - API Fundamentals - postman collection
Agile Testing Days 2018 - API Fundamentals - postman collection
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformation
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
 
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
 
Elasticsearch for SQL Users
Elasticsearch for SQL UsersElasticsearch for SQL Users
Elasticsearch for SQL Users
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!
 
Advanced Json
Advanced JsonAdvanced Json
Advanced Json
 
Drupal Mobile
Drupal MobileDrupal Mobile
Drupal Mobile
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDb
 
Ampersandjs
AmpersandjsAmpersandjs
Ampersandjs
 
LF_APIStrat17_Embracing JSON Schema
LF_APIStrat17_Embracing JSON SchemaLF_APIStrat17_Embracing JSON Schema
LF_APIStrat17_Embracing JSON Schema
 
AST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScript
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3
 
Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018
 
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
 
Introduction to MongoDB for C# developers
Introduction to MongoDB for C# developersIntroduction to MongoDB for C# developers
Introduction to MongoDB for C# developers
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
d3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlind3sparql.js demo at SWAT4LS 2014 in Berlin
d3sparql.js demo at SWAT4LS 2014 in Berlin
 

Dernier

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 

Dernier (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

JSON Schema in Web Frontend #insideFE

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. 1 { 2 "name": "pirosikick" 3 "age": 28, 4 "email": "pirosikick@example.com" 5 }
  • 14. 1 { 2 "type": "object", 3 "properties": { 4 "name": { "type": "string" }, 5 "age": { 6 "type": "integer", 7 "minimum": 0 8 }, 9 "email": { 10 "type": "string", 11 "format": "email" 12 } 13 } 14 }
  • 15. 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "$id": "http://example.com/schema.json#", 4 "type": "object", 5 "definitions": { 6 "name": { ... }, 7 "age": { ... }, 8 "email": { ... }, 9 }, 10 "properties": { 11 "name": { 12 "$ref": "#/definitions/name" 13 }, 14 "age": { 15 "$ref": "#/definitions/age" 16 }, 17 "email": { 18 "$ref": "#/definitions/email" 19 } 20 } 21 }
  • 16. 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "$id": "http://example.com/schema.json#", 4 "type": "object", 5 "definitions": { 6 "name": { ... }, 7 "age": { ... }, 8 "email": { ... }, 9 }, 10 "properties": { 11 "name": { 12 "$ref": "#/definitions/name" 13 }, 14 "age": { 15 "$ref": "#/definitions/age" 16 }, 17 "email": { 18 "$ref": "#/definitions/email" 19 } 20 } 21 }
  • 17. 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "$id": "http://example.com/schema.json#", 4 "type": "object", 5 "definitions": { 6 "name": { ... }, 7 "age": { ... }, 8 "email": { ... }, 9 }, 10 "properties": { 11 "name": { 12 "$ref": "#/definitions/name" 13 }, 14 "age": { 15 "$ref": "#/definitions/age" 16 }, 17 "email": { 18 "$ref": "#/definitions/email" 19 } 20 } 21 }
  • 18. 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "$id": "http://example.com/schema.json#", 4 "type": "object", 5 "definitions": { 6 "name": { ... }, 7 "age": { ... }, 8 "email": { ... }, 9 }, 10 "properties": { 11 "name": { 12 "$ref": "#/definitions/name" 13 }, 14 "age": { 15 "$ref": "#/definitions/age" 16 }, 17 "email": { 18 "$ref": "#/definitions/email" 19 } 20 } 21 }
  • 19. 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "$id": "http://example.com/schema.json#", 4 "type": "object", 5 "definitions": { 6 "name": { ... }, 7 "age": { ... }, 8 "email": { ... }, 9 }, 10 "properties": { 11 "name": { 12 "$ref": "#/definitions/name" 13 }, 14 "age": { 15 "$ref": "#/definitions/age" 16 }, 17 "email": { 18 "$ref": "#/definitions/email" 19 } 20 } 21 }
  • 20.
  • 21.
  • 22. 1 { 2 "$schema": "http://json-schema.org/draft-04/hyper-schema", 3 "type": "object", 4 "definitions": { ... }, 5 "properties": { ... }, 6 "links": [{ 7 "title": "ユーザ取得", 8 "description": "idに紐づくユーザを返す", 9 "href": "/user/:id", 10 "method": "GET", 11 "rel": "self" 12 }, { 13 "title": "ユーザ新規登録", 14 "description": "idに紐づくユーザを返す", 15 "href": "/user", 16 "method": "POST", 17 "rel": "create", 18 "schema": { 19 "type": "object", 20 "properties": { ... } 21 } 22 }] 23 }
  • 23. 1 { 2 "$schema": "http://json-schema.org/draft-04/hyper-schema", 3 "type": "object", 4 "definitions": { ... }, 5 "properties": { ... }, 6 "links": [{ 7 "title": "ユーザ取得", 8 "description": "idに紐づくユーザを返す", 9 "href": "/user/:id", 10 "method": "GET", 11 "rel": "self" 12 }, { 13 "title": "ユーザ新規登録", 14 "description": "idに紐づくユーザを返す", 15 "href": "/user", 16 "method": "POST", 17 "rel": "create", 18 "schema": { 19 "type": "object", 20 "properties": { ... } 21 } 22 }] 23 }
  • 24. 1 { 2 "$schema": "http://json-schema.org/draft-04/hyper-schema", 3 "type": "object", 4 "definitions": { ... }, 5 "properties": { ... }, 6 "links": [{ 7 "title": "ユーザ取得", 8 "description": "idに紐づくユーザを返す", 9 "href": "/user/:id", 10 "method": "GET", 11 "rel": "self" 12 }, { 13 "title": "ユーザ新規登録", 14 "description": "idに紐づくユーザを返す", 15 "href": "/user", 16 "method": "POST", 17 "rel": "create", 18 "schema": { 19 "type": "object", 20 "properties": { ... } 21 } 22 }] 23 }
  • 25.
  • 26.
  • 27. 1 #!/bin/bash 2 # vim: set background=light nolist nonumber: 3 4 # 雛形を生成 5 # - schemata以下にリソース毎にファイルを生成 6 # - JSONとYAMLで書くことが出来る(--yamlでYAML) 7 prmd init --yaml user > schemata/user.yaml 8 9 # JSON Hyper-Schema(schema.json)の生成 10 # - ./schemata/*.{yaml,json}とmeta.jsonを結合して生成する 11 prmd combine -m meta.json ./schemata > schema.json 12 13 # Markdownの生成 14 # - prmd combineで生成したschema.jsonからREADME.mdを生成 15 # - OVERVIEW.mdを出力ファイルの先頭に挿入 16 prmd doc --prepend OVERVIEW.md schema.json > README.md
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. 1 const schema = { 2 "type": "object", 3 "properties": { 4 "name": { 5 "title": "名前", 6 "type": "string" 7 }, 8 "email": { 9 "title": "メールアドレス", 10 "type": "string", 11 "format": "email" 12 } 13 } 14 };
  • 42. 1 import React from 'react'; 2 import { render } from 'react-dom'; 3 import Form from 'react-jsonschema-form'; 4 5 const schema = { ... }; 6 7 render( 8 <Form 9 schema={schema} 10 onChange={({ formData }) => { ... }} 11 onSubmit={({ formData }) => { ... }} 12 />, 13 document.getElementById('wrapper') 14 );
  • 43.
  • 44. 1 const uiSchema = { 2 "name": { 3 "classNames": "from__name", // カスタムクラス名 4 "ui:placeholder": "全角で頼む" // プレースホルダー 5 }, 6 "email": { 7 "classNames": "from__email", 8 "ui:placeholder": "you@example.com" 9 } 10 }; 11 12 render( 13 <Form 14 schema={schema} 15 uiSchema={uiSchema} 16 onChange={({ formData }) => { ... }} 17 onSubmit={({ formData }) => { ... }} 18 />, 19 document.getElementById('wrapper') 20 );
  • 45.
  • 46.
  • 47. 1 const uiSchema = { 2 "name": { 3 // カスタムフィールド 4 "ui:field": CustomeField, 5 }, 6 "email" :{ 7 // カスタムウィジェット 8 "ui:widget": CustomeWidget, 9 } 10 };
  • 49.
  • 50.