DEV Community

Mahbub Ferdous Bijoy
Mahbub Ferdous Bijoy

Posted on

YAML Syntax And So More

here is key : value

key : value
app : user-authentication


#this all about key value just remember to put indentation 

Enter fullscreen mode Exit fullscreen mode

there is all variable in YAML.

#string
app : user-authentication

#integer 
port : 8000

#float
version : 1.7

#boolean
deployed : true 

Enter fullscreen mode Exit fullscreen mode

here is all objects YAML

microservices : 
  app : payment-app
  port : 9001
  version : 1.9
  deployed : false

Enter fullscreen mode Exit fullscreen mode

here is list

fruits : 
  - apple
  - kiwi
  - banana
  - orange
  - nuts : 
    - almond
    - cashew

Enter fullscreen mode Exit fullscreen mode

here is all multiline yaml, list with objects

---
microservices : 
  - name : user-authentication
    port : 9001
    version : 1.9
    deployed : true
  - name : payment-app
    port : 9002
    version : 1.8
    deployed : false
  - name : db-app
    port : 9003
    version : 1.8
    deployed : true 

---

## schools --> name, principal --> students --> name,rollnumber,parents,number

schools:
- name : MHS
  principal : Gius
  students :
  - name: Mahbub
    roolnumber : 7
    parents : 
    - father : rahim
    - mother : josna
    number: 460

Enter fullscreen mode Exit fullscreen mode

Top comments (0)