#JSON

2025-07-11

“Fun” learning YAML properly?

Okay. So. I have to learn ANSI-Bell for $ork. Meh. But okay.

Pre-existing “fun”

Playbooks are written in YAML. I hate YAML and have always used yaml2jsn to convert it to JSON (if possible) when I had to touch it in the past, as somehow a subset¹² of JSON is a valid subset of YAML accepted² by YAML parsers.

① you’ll have to make sure you don’t emit some codepoints literally, and to format numbers in scientific notation a specific way, but that’s generally a good advice for JSON emitters
② except JSON strings have codepoints outside the Basic Multilingual Plane encoded as two UTF-16 surrogates in \u#### notation whereas YAML parsers require it to be unescaped four-octet UTF-8, which breaks many JSON parsers; I ran into that just this week, in fact, for my RSS to Fediverse gateways…

I personally find YAML unwritable, due to things like GitHub Actions’ example of…

on:
  push:
    branches:
      - main

… does not convert to…

{
  "on": {
    "push": {
      "branches": [
        "main"
      ]
    }
  }
}

… but to:

{
  "1": {
    "push": {
      "branches": [
        "main"
      ]
    }
  }
}

(GitHub accepts both syntacēs in workflow files in JSON.)

But let’s go back to the “self-explaining, obvious” YAML:

on:
  push:
    branches:
      - main

So, we’ve already established that “on” is 1 and that something like country: no isn’t Norway but 0 (and real existing people have fallen into this, yet there are strong recommendations to not quote strings in YAML documents like ANSI-Bell playbooks, and somehow nobody even documents how strings are to be escaped and when they need to be escaped).

But, riddle me this:

push:
<2 spaces>branches:

But:

branches:
<2 spaces><hyphen-minus and space>main

But:

options:
<no space><hyphen-minus and space>Ubuntu
<no space><hyphen-minus and space>macOS

(All examples from here.)

I find this totally obvious and self-explanatory and consistent, and I totally know when to use two spaces, or dash-plus-space, or both.</sarcasm>

But there is training material!

One of the books I’ve been provided (actual published training material with an ISBN each) just hand-waves it away, the other says:

The target section looks like the following code snippet:

  - hosts: webservers
    user: root

[…] As per the YAML syntax, the line must start with a dash. […]

So, basically, the hosts: line must start with a dashhyphen-minus? I think not.

The “Hands-on interactive lab and helpful resources” in the Red Hat “YAML essentials for Ansible” “learning path” is similarly deficient in even fundamentally basic explanation. 0/10, won’t recommend.

Fun with training material, continued

The hand-waving book links to http://www.yaml.org/start.html, so let’s read…

a getting started guide for YAML

… in my favourite webbrowser lynx:

                                                   Page not found · GitHub Pages
 
 
   File not found
 
   The  site  configured  at  this  address does not contain the requested
   file.
 
   If  this is your site, make sure that the filename case matches the URL
   as well as any file permissions.
   For root URLs (like http://example.com/) you must provide an index.html
   file.
 
   [1]Read  the full documentation for more information about using GitHub
   Pages.
   [2]GitHub Status — [3]@githubstatus
 
 
 
 
 
 
 
Edit this document's URL: https://yaml.org/start.html

… oooookay?

But surely yaml.org has more material? *looks* … well, it has links to the specs and implementations. All very useful, but not right now for a hopefully structured introduction that explains the hows and ideally also the whys.

Let’s follow the *New* link in which they announce the 1.2.2 spec… a blogpost. Okay. It has a title bar (brown background in Firefox) with a promising link:

   Y
 
     *
     * [2]Blog
     * [3]Docs

Let’s follow #3 to “Docs”!

←←←                                                                      Twitter
   [1]Skip to main content
 
   Y
 
     *
     * [2]Blog
     * [3]Docs
 
     *
     *
 
   [4]YAML Glossary
 
   [5]YAML Cheat Sheet
 
   (BUTTON) Menu
 
YAML Documentation
     __________________________________________________________________
 
   YAML documentation is on the way!
 
#content

This 80×24 screenshot is literally the entirety of the official #YAML documentation.

Well, colour me impressed.

Wait, no.

Fuck that shit.

Wait. This is for $dayjob. $customer also edits playbooks. I’m sure they’ll be delighted if I run things through yaml2jsn and commit the result as #JSON.

Also, see footnote 2 above.

Fuuuuck I’m SOL.

So. Do I honestly have to wade through the spec to learn this?

(Not that this is new. When I first learnt Python in 2008, I had to look at the C-language source code of the #Python interpreter to figure out things missing from the documentation. Which brings us back full circle to #ansible, the culprit of bringing this entire shitshow to my attention. I’m a programmer, not a DevCloudOp or something.)

2025-07-09

Day 15

Today I implemented full user registration with email verification.
Registration creates an inactive account and sends a verification link with a JWT token.
Verification activates the account if the token is valid and not expired, and assigns the user to the default trial subscription plan.

I also introduced a custom JSON-based translation system, with language selected via the `x-lang` HTTP header.

Finally, I refactored subscription logic: a separate `plans` table was added.

Everything works. All tests passed.

write.tyolabs.com/2025/07/10/d

#programming #jwt #subscription #json #monorepo #saas #codingdays

2025-07-09

oh, i almost forgot:

- #PHP is great
- #JSON schema validation is great: github.com/opis/json-schema
- multipleOf + FLOAT is 🤮

thank god there is: \Opis\JsonSchema\Helper::$useBCMath = false; 🙏

2025-07-08

#PostgreSQL Postgres Meetup for All. Tomorrow 7/9. All about the #JSON. meetup.com/postgres-meetup-for

shevabamshevabam
2025-07-08

A relire : Générer un JSON contenant des jeux d'essais réalistes

blog.shevarezo.fr/post/2017/03

@JSONGenerator

2025-07-08

第249回 MySQLに格納した複雑なJSONから値を検索する
gihyo.jp/article/2025/07/mysql

#gihyo #技術評論社 #gihyo_jp #MySQL #JSON

Dotan Horovits #CNCFAmbassadorhorovits@fosstodon.org
2025-07-07

Querying nested JSON has been a pain in the neck. Often you find yourself needing to extract specific values from deeply nested JSON objects, or transform nested arrays into a more analyzable format, and find yourself using complex workarounds with poor query performance.

The latest #OpenSearch 3.1 release features new PPL query commands exactly for that:

🧵
@OpenSearchProject @linuxfoundation #search #query #json

2025-07-07

Continuing messing around with encoding Haxe classes and enums to something I can cram into Json.
Next stop is reference loops, for which I need a path primitive.

I'm using some bits out of jsonld (like the \@ prefix) to make it more readable and cross platform.

I had Stig, which is a formalish vector notation compatible with EDN and JSON, but it hits a brick wall with json interop (jq and such), and this should fix that.

The Haxe Algebraic Schema Language (Hasl), based on TASL (tiny algebraic syntax language) is perty, and I guess I need unwound data structures for transport.

I really like Malli, but outside of Clojure there's problems with the boundary between macro-time and run-time.

#Haxe #Programming #Edn #Json #Malli #Clojure

shevabamshevabam
2025-07-05

A relire : Transformer n'importe quelle Google Sheet en une API avec Sheety

blog.shevarezo.fr/post/2019/02

@phillipcaudell

Anthony Acciolyanthony@accioly.social
2025-07-05

Playing with Go 1.25 RC… encoding/json/v2 is sweet and noticeably faster than what we have right now.
(That said, since I can still marshal and unmarshal JSON faster using plain old "slow" Java, I'm only giving Go a half-win here.)

antonz.org/go-json-v2/

#Golang #json #rc

2025-07-04

The Hottest AI Trading Technology of 2025: A Smart Trading Guide to FMZ Platform with Claude (Part 1)
The FMZ platform’s recent release of MCP is a bold and practical innovation—it enables users to control trading strategies and manage task flows directly through natural language. This simplifies the exploration of broader quantitative trading application scenarios greatly.

fmz.com/bbs-topic/10693

2025-07-03

I used to hate seeing this used in #commonlisp but I'm doing the equivalent more and more decoding #fediverse #json in #swiftlang

lisp-docs.github.io/cl-languag

2025-07-03

Wow !!!

Mr. Mastodon Farm: analysing a mastodon ActivityPub outbox.json file(分析 Mastodon 的 outbox.json 檔案) – quantixed
quantixed.org/2023/07/29/mr-ma

#mastodon #activitypub #json

BCWHSBCWHS
2025-07-03

Digital Toolbox: JSON
An open standard file format and data interchange format that uses human-readable text to store and transmit data objects.
wadebach.blackcatwhitehatsecur

Digital Toolbox: JSON
An open standard file format and data interchange format that uses human-readable text to store and transmit data objects.
Hacker Newsh4ckernews
2025-07-03

Gmailtail – Command-line tool to monitor Gmail messages and output them as JSON

github.com/c4pt0r/gmailtail

2025-07-03

From #CTAN:

Jasper Habicht submitted an update to the jsonparse package.

Version: 1.6.3 2025-06-20
License: lppl1.3c

Summary description: Parse, store and access JSON data in LaTeX documents

ctan.org/pkg/jsonparse

#TeXLaTeX #json

Sébastien Stormacqsebsto
2025-07-02

JMESPath for Swift is now part of JMESPath.org.
jmespath.org/

JMESPath is a query language for JSON. There are now 8 languages officially supported.
Check the list here 👉 github.com/jmespath

Frontend Dogmafrontenddogma@mas.to
2025-07-01

I Copy These 10 Code Snippets Into Every Project, by (not on Mastodon or Bluesky):

archive.fo/NWE6H

#javascript #debouncing #json #objects #arrays

Platform Engineering Labsplateng_labs
2025-07-01

is great for config, but small syntax quirks can slow you down.

We broke down three rules to make output predictable, with one quick way to verify results.

Read it here: medium.com/platform-engineerin

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst