Lädt...


🔧 WSON (Web Simple Object Notation)


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

WSON is a new data serialization format designed to address the shortcomings of JSON and YAML.

GitHub

Syntax Definition

1. Basic Structure

  • The contents of a WSON file are enclosed in curly baces {}, which represent an object.
  • An object consists of key-value pairs.
  • Keys and values are separated by either a colon (:) or an equals sign (=).

2. Comments

  • Comments begin with // or # and are written on a single line.
  • Comments apply until the end of the line.
  • Multi-line comments are not supported; for comments spanning multiple lines, add // or # at the start of each line.

3. Object

  • An object is enclosed in curly barces {} and contains key-value pairs.
  • You can use either : or = between keys and values, and both symbols can be mixed within the same object
  • Each attribute is separated by a comma ,.
  • Objects can be nested within other objects.

Example:

{
    status: "success",
    code = 200,
    user = {
        id: 123,
        name: "John Doe"
    }
}

4. Array

  • Arrays are enclosed in square brackets [], and elements are separated by commas ,.
  • Array elements can include objects, strings, numbers, and other data types.
  • In WSON, arrays can be nested within objects, and arrays can contain other arrays or objects.

Example:

tasks: [
    {
        task_id: 1,
        title: "Complete project report"
    },
    {
        task_id: 2,
        title: "Review team feedback"
    }
]

5. Key-Value Pair

  • Attribute names are strings and are followed by either : or =, with the value placed immediately after.
  • Value types include strings, numbers, booleans, objects, and arrays.
  • Strings are enclosed in double quotes ".
  • Numbers are used without quotes and can be integers or floating-point values.

Example:

name: "John Doe"
age = 25

6. Data Types

  • String: Text enclosed in double quotes ".
"hello world"
  • Number: An integer or floating-point value.
42
3.14
  • Boolean: Uses true or false valuse.
is_active = true
  • Object: Key-value pairs enclosed in curly braces {}.
  • Array: A list of elements enclosed in square brackets [].

7. Example Explanation

{
    // Status code and message information
    status: "success",
    code: 200,
    message: "Data retrieved successfully",

    user = {
        id = 123,
        name: "John Doe",
        email: "[email protected]",
        age: 25  # User age
    },

    tasks: [
        {
            task_id: 1,
            title: "Complete project report",
            status: "in-progress",
            due_date: "2024-10-15"
        },
        {
            task_id: 2,
            title: "Review team feedback",
            status: "pending",
            due_date: "2024-10-20"
        }
    ]
}
...

🔧 WSON (Web Simple Object Notation)


📈 75.16 Punkte
🔧 Programmierung

🔧 Dot Notation vs Bracket Notation for Object Properties – What's the Difference?


📈 45.32 Punkte
🔧 Programmierung

🔧 Dot Notation vs Bracket Notation for Object Properties – What's the Difference?


📈 45.32 Punkte
🔧 Programmierung

🔧 JavaScript Object Properties: Dot Notation or Bracket Notation?


📈 45.32 Punkte
🔧 Programmierung

🔧 Dot Notation vs Bracket Notation for Object Properties – What's the Difference?


📈 45.32 Punkte
🔧 Programmierung

🎥 JavaScript Object Notation (JSON) | Python for Beginners [38 of 44]


📈 26.79 Punkte
🎥 Video | Youtube

🔧 JSON – JavaScript Object Notation


📈 26.79 Punkte
🔧 Programmierung

🔧 O que é JSON (Javasript Object Notation) e como usamos ?


📈 26.79 Punkte
🔧 Programmierung

🔧 What is JSON ( Javacript Object Notation ) and how to use it


📈 26.79 Punkte
🔧 Programmierung

🔧 Intensive JSON Course: Mastering JavaScript Object Notation


📈 26.79 Punkte
🔧 Programmierung

🔧 Why JavaScript Says "[object Object]" and Not Just "[object]" 🤔


📈 24.76 Punkte
🔧 Programmierung

🕵️ CVE-2022-44108 | pdftojson 94204bb Object.cc Object::copy(Object*) stack-based overflow


📈 24.76 Punkte
🕵️ Sicherheitslücken

🔧 Understanding Big O Notation with a Library Analogy


📈 18.53 Punkte
🔧 Programmierung

🔧 Time Complexity, Space Complexity and Big O Notation


📈 18.53 Punkte
🔧 Programmierung

🔧 BigO (Big Oh) Notation


📈 18.53 Punkte
🔧 Programmierung

🔧 Understanding Big-O Notation


📈 18.53 Punkte
🔧 Programmierung

🔧 Demystifying Big O Notation: A Deep Dive into Algorithm Efficiency


📈 18.53 Punkte
🔧 Programmierung

🔧 What Is Big O Notation? A Beginner’s Guide to Algorithm Efficiency


📈 18.53 Punkte
🔧 Programmierung

🔧 big 0 notation: laundry day


📈 18.53 Punkte
🔧 Programmierung

🍏 NCH Crescendo Music Notation Editor Pro 8.86


📈 18.53 Punkte
🍏 iOS / Mac OS

🔧 One-Byte: Last one: Big O Notation


📈 18.53 Punkte
🔧 Programmierung

🔧 Understanding Big O Notation in Python


📈 18.53 Punkte
🔧 Programmierung

🍏 MuseScore 4.0.0 - Music notation program.


📈 18.53 Punkte
🍏 iOS / Mac OS

🔧 Big-Oh Notation: Key to Evaluating Algorithm Efficiency


📈 18.53 Punkte
🔧 Programmierung

🔧 Big O Notation: Speed Dating for Algorithms


📈 18.53 Punkte
🔧 Programmierung

🔧 Developing Efficient Algorithms - Measuring Algorithm Efficiency Using Big O Notation


📈 18.53 Punkte
🔧 Programmierung

🐧 Jello v1.3 now supports dot notation (Command-line JSON filter using python syntax)


📈 18.53 Punkte
🐧 Linux Tipps

🔧 Demystifying Big O Notation.


📈 18.53 Punkte
🔧 Programmierung

🔧 Big O Notation


📈 18.53 Punkte
🔧 Programmierung

🔧 Big O notation For dummies


📈 18.53 Punkte
🔧 Programmierung

🐧 gpg-tui v0.3.0 is released, it now shows notation data of the signatures!


📈 18.53 Punkte
🐧 Linux Tipps

🔧 Evaluate Reverse Polish Notation | LeetCode | Java


📈 18.53 Punkte
🔧 Programmierung

🔧 Introducing Do Notation in the Mo Package for Golang


📈 18.53 Punkte
🔧 Programmierung

💾 Crescendo Free Music Notation Editor


📈 18.53 Punkte
💾 Downloads

matomo