schema

Custom Jekyll Plugin (Liquid Filter?) rendering script tags as text, not as JavaScript

百般思念 提交于 2020-06-29 02:50:41
问题 I'm experimenting with building a site using Jekyll for a friend. I'm trying to transform front matter from files like /_events/2020-02-25-an-event.md and /_events/2020-02-26-another-event.md into something that can be easily embedded into the body of various building blocks of content and result in those pages, as viewed by a visitor, including <script type="application/ld+json">...</script> tags conforming to schema.org event standards. A file like /_events/2020-02-25-an-event.md looks like

Joi validation - how to require or optional field based on another key exists in array?

孤人 提交于 2020-06-12 18:57:49
问题 I have this Joi schema: let schema = {}; let stations = { contact: { first_name: Joi.string().min(2).max(10).regex(Regex.alphabeta, 'alphabeta').allow("").error(JoiCustomErrors), last_name: Joi.string().min(2).max(10).regex(Regex.alphabeta, 'alphabeta').allow("").error(JoiCustomErrors), phone: Joi.string().min(10).max(10).regex(Regex.num, 'num').allow("").error(JoiCustomErrors), }, address: { place: Joi.string().min(2).max(10).regex(Regex.alphanum, 'alphanum').required().error(JoiCustomErrors

Joi validation - how to require or optional field based on another key exists in array?

こ雲淡風輕ζ 提交于 2020-06-12 18:55:10
问题 I have this Joi schema: let schema = {}; let stations = { contact: { first_name: Joi.string().min(2).max(10).regex(Regex.alphabeta, 'alphabeta').allow("").error(JoiCustomErrors), last_name: Joi.string().min(2).max(10).regex(Regex.alphabeta, 'alphabeta').allow("").error(JoiCustomErrors), phone: Joi.string().min(10).max(10).regex(Regex.num, 'num').allow("").error(JoiCustomErrors), }, address: { place: Joi.string().min(2).max(10).regex(Regex.alphanum, 'alphanum').required().error(JoiCustomErrors

Joi validation - how to require or optional field based on another key exists in array?

天涯浪子 提交于 2020-06-12 18:54:24
问题 I have this Joi schema: let schema = {}; let stations = { contact: { first_name: Joi.string().min(2).max(10).regex(Regex.alphabeta, 'alphabeta').allow("").error(JoiCustomErrors), last_name: Joi.string().min(2).max(10).regex(Regex.alphabeta, 'alphabeta').allow("").error(JoiCustomErrors), phone: Joi.string().min(10).max(10).regex(Regex.num, 'num').allow("").error(JoiCustomErrors), }, address: { place: Joi.string().min(2).max(10).regex(Regex.alphanum, 'alphanum').required().error(JoiCustomErrors

Social web application database design: how can I improve this schema?

爱⌒轻易说出口 提交于 2020-06-09 07:54:37
问题 Background I am developing a social web app for poets and writers, allowing them to share their poetry, gather feedback, and communicate with other poets. I have very little formal training in database design, but I have been reading books, SO, and online DB design resources in an attempt to ensure performance and scalability without over-engineering. The database is MySQL, and the application is written in PHP. I'm not sure yet whether we will be using an ORM library or writing SQL queries

How to change the name of the active scheme in Xcode?

橙三吉。 提交于 2020-06-09 07:37:47
问题 I managed to change my project name, but how do I change the name displayed directly to the left of "iOS Simulator"? 回答1: This is in the Xcode documentation available from the "Help" menu. Choose "Help" > "Xcode Help", then enter "rename scheme" to find it. Here are the steps: Choose "Edit Scheme" from the "Product" menu. Click on the "Manage Schemes…" button Select the scheme whose name you wish to change Press the "Return" key It will select the name of the scheme and allow you to edit it.

Is it possible to create a JSON Schema with allOf (multiple if and then) and $ref?

荒凉一梦 提交于 2020-05-29 10:15:50
问题 I am trying to create a complex schema that will check for the value of a property and then validate according to the value of that same property. I am wondering if it's possible to use $ref and allOf in the same schema and if so, how? I am having some trouble getting this to work. It may be important to note that I am using AJV. Please see my code below { "$ref": "#/definitions/Welcome", "definitions": { "Welcome": { "properties": { "auth": { "type": "string", "enum": ["oauth1","oauth2"] },

What is the Correct way to define key-value pairs in json schema

天涯浪子 提交于 2020-05-29 03:21:32
问题 How do i define key value pairs object in json schema (the "correct" way) ? i want to define this: "id" : 99, _info : { "name" : "somename", "href" : "someUrl" } Are any of the following two accurate?: 1) { "type": "object", "name": "MyObj", "properties": { "id": { "type": "integer" }, "_info": { "type": "array", "items": { "type": "object" "properties": { "key": { "type": "string", "description": "key" }, "value": { "type": "string", "description": "the value" } } } } } } 2) { "type":

Creating sample Avro data for bytes type

╄→尐↘猪︶ㄣ 提交于 2020-05-28 07:19:13
问题 I am trying to create a sample .avro file containing bytes as type and decimal as logicalType, But the avro file when loaded to hive table results in a different value. What could be the reason? schema.avsc: { "type" : "record", "name" : "example", "namespace" : "com.xyz.avro", "fields" : [ { "name" : "cost", "type" : { "type" : "bytes", "logicalType" : "decimal", "precision" : 38, "scale" : 10 } }] } data.json: { "cost" : "0.0" } Converted to .avro using avro-tools : java -jar avro-tools-1.8

Creating sample Avro data for bytes type

落爺英雄遲暮 提交于 2020-05-28 07:16:46
问题 I am trying to create a sample .avro file containing bytes as type and decimal as logicalType, But the avro file when loaded to hive table results in a different value. What could be the reason? schema.avsc: { "type" : "record", "name" : "example", "namespace" : "com.xyz.avro", "fields" : [ { "name" : "cost", "type" : { "type" : "bytes", "logicalType" : "decimal", "precision" : 38, "scale" : 10 } }] } data.json: { "cost" : "0.0" } Converted to .avro using avro-tools : java -jar avro-tools-1.8