当前位置:网站首页>Yaml language-01 (data type, array, object)
Yaml language-01 (data type, array, object)
2022-07-26 07:36:00 【Xiaolesheng】
YAML It's a similar XML、JSON The Markedness of language . It emphasizes data Centered , It's not about logo language . thus YAML The definition itself is relatively simple , It's called " A humanized data format language ".
<heima>
<age>15</age>
<address>Beijing</address>
</heima>
heima:
age: 15
address: Beijing
YAML Its grammar is relatively simple , There are mainly the following :
- Case sensitive
- Use indentation to indicate hierarchy
- Indenting is not allowed tab, Only spaces are allowed ( Low version limit )
- The number of indented spaces doesn't matter , Just align the elements at the same level to the left
- '#' Notation
YAML The following data types are supported :
- Pure quantity : A single 、 Nonseparable value
- object : Set of key value pairs , Also known as mapping (mapping)/ Hash (hash) / Dictionaries (dictionary)
- Array : A set of values in order , Also called sequence (sequence) / list (list)
# Pure quantity , It means a simple value , character string 、 Boolean value 、 Integers 、 Floating point numbers 、Null、 Time 、 date
# 1 Boolean type
c1: true ( perhaps True)
# 2 integer
c2: 234
# 3 floating-point
c3: 3.14
# 4 null type
c4: ~ # Use ~ Express null
# 5 The date type
c5: 2018-02-17 # Date must use ISO 8601 Format , namely yyyy-MM-dd
# 6 Time type
c6: 2018-02-17T15:02:31+08:00 # Time use ISO 8601 Format , Use... Between time and date T Connect , Finally using + Represents the time zone
# 7 String type
c7: heima # Simple writing , Write the value directly , If there are special characters in the middle of the string , You must use double quotation marks or single quotation marks to wrap
c8: line1
line2 # If there are too many strings, you can split them into multiple lines , Each line is converted to a space
# object
# Form 1 ( recommend ):
heima:
age: 15
address: Beijing
# Form 2 ( understand ):
heima: {
age: 15,address: Beijing}
# Array
# Form 1 ( recommend ):
address:
- Shunyi
- Changping
# Form 2 ( understand ):
address: [ Shunyi , Changping ]
tip :
1 Writing yaml Bear in mind
:Add a space after it2 If necessary, multi segment yaml Put the configuration in a file , Use in the middle
---Separate3 Here's a yaml turn json Website , It can be used to verify yaml Whether the writing is correct
边栏推荐
- Command line execution and test report generation of JMeter performance test
- Learning Efficient Convolutional Networks Through Network Slimming
- System architecture & microservices
- 如何保证缓存和数据库的双写一致性?
- NLP natural language processing - Introduction to machine learning and natural language processing (3)
- 2022.7.22DAY612
- 力扣(LeetCode)206. 反转链表(2022.07.25)
- OVS underlying implementation principle
- Download and install the free version of typora
- KDD2022 | 揭秘快手短视频推荐Re-ranking之谜,相关推荐新SOTA
猜你喜欢

China Unicom transformed the Apache dolphin scheduler resource center to realize the one-stop access of cross cluster call and data script of billing environment

【uniapp】多种支付方式封装

:app:checkDebugAarMetadata 2 issues were found when checking AAR metadata: 2 issues were found when

排序:归并排序和快速排序

Jmeter性能测试之将每次接口请求的结果保存到文件中

HCIP---MPLS详解和BGP路由过滤

Fang Wenshan, Jay Chou's best partner, will officially announce "Hualiu yuancosmos" on July 25

爬虫->TpImgspider

Sort: merge sort and quick sort

Meta universe infrastructure: analysis of the advantages of Web 3.0 chain33
随机推荐
Fang Wenshan, Jay Chou's best partner, will officially announce "Hualiu yuancosmos" on July 25
JMeter performance test saves the results of each interface request to a file
Hystrix配置简单说明
NFT digital collection system development: activating digital cultural heritage
TensorFlow学习日记之tflearn
NFT digital collection system development: what are the best digital marketing strategies for NFT digital collection
PyTorch
Interview question set
Machine learning related competition website
Polymorphism, final and interface
2021全球机器学习大会演讲稿
以太网交换安全
Jmeter性能测试之使用存储响应内容到文件监听器
Deep learning model deployment
Command line execution and test report generation of JMeter performance test
【每日一题】919. 完全二叉树插入器
Regression analysis code implementation
PXE efficient batch network installation
Tensorflow learning diary tflearn
Summary of API method