package yojson

  1. Overview
  2. Docs
Yojson is an optimized parsing and printing library for the JSON format

Install

dune-project
 Dependency

Authors

Maintainers

Sources

yojson-1.7.0.tbz
sha256=656fc65f794186274f8b961dc38daba9e2de2fc993829291defbda2186812cc6
md5=b89d39ca3f8c532abe5f547ad3b8f84d

Description

Yojson is an optimized parsing and printing library for the JSON format.

It addresses a few shortcomings of json-wheel including 2x speedup, polymorphic variants and optional syntax for tuples and variants.

ydump is a pretty-printing command-line program provided with the yojson package.

The program atdgen can be used to derive OCaml-JSON serializers and deserializers from type definitions.

Added to opam-repository:

README

Yojson: low-level JSON library for OCaml

Build Status

This library is for manipulating the json AST directly. For mapping between OCaml types and json, we recommend atdgen.

Library documentation

Currently at https://ocaml-community.github.io/yojson/

Design goals

  • reducing inter-package dependencies by the use of polymorphic variants for the JSON tree type
  • allowing variants of the JSON tree type to be shipped by the library itself or to be easily created as extensions of the library
  • allowing type-aware serializers/deserializers such as json-static to read and write directly without going through a JSON tree, for efficiency purposes. This requires making readers and writers of JSON atoms (int, string, etc.) to be exported and composable.
  • providing a few non-standard, optional extensions of JSON. These extensions will include:

    • optional quotes around "simple" field/constructor names
    • a syntax for tuples (at least 2 elements): (x, y)
    • a syntax for variants (0 or 1 arg only): <Foo> <Bar:"abc">

Other choices already in json-wheel

  • distinction between ints and floats (optional)
  • Getting rid of the UTF-X encoding constraint that prevents from exchanging binary data:

    • encoding is ASCII except for the contents of string literals
    • string literals may represent arbitrary sequence of bytes
    • \uABCD escapes in string literals expand to UTF-8

Miscellaneous

  • no dependency on ocamlnet for UTF-8

Dependencies (5)

  1. biniou >= "1.2.0"
  2. easy-format
  3. cppo build
  4. dune
  5. ocaml >= "4.02.3"

Dev Dependencies (1)

  1. alcotest with-test & >= "0.8.5"

  1. 0install
  2. acgtk
  3. amlc-lsp
  4. anthropic
  5. archetype
  6. atd >= "2.6.0"
  7. atdgen < "2.10.0"
  8. atdgen-runtime < "2.10.0"
  9. atproto
  10. avro-compiler
  11. aws-config
  12. aws-s3 < "4.5.1" | >= "4.8.0"
  13. awskit-lwt-unix
  14. awskit-s3
  15. awsm-codegen
  16. bap-radare2
  17. bitcoin
  18. bitflyer
  19. boulangerie
  20. boulodrome
  21. builder-web >= "0.2.0"
  22. cabal
  23. caisar
  24. calculon
  25. camelot >= "1.4.2"
  26. camels
  27. canary
  28. cb-check
  29. cbor
  30. cdp
  31. cdp-gen
  32. chess_com_api
  33. colibrics
  34. comby
  35. comby-kernel
  36. comby-semantic
  37. commons
  38. containers >= "3.9"
  39. coq-lsp
  40. coq-of-ocaml
  41. coq-serapi < "8.20.0+0.20.0"
  42. current_docker
  43. current_examples
  44. current_git
  45. current_github
  46. current_gitlab
  47. current_slack
  48. current_ssh
  49. current_web
  50. dap
  51. daypack-lib
  52. dblp-api
  53. decoders-yojson
  54. devkit
  55. dnsrobot
  56. docker-api
  57. docker_hub
  58. dot-merlin-reader < "4.9"
  59. dream
  60. dream-inertia
  61. dropbox
  62. dune-release >= "1.4.0"
  63. ecma-regex
  64. elasticsearch-cli = "0.5"
  65. elpi >= "3.3.1"
  66. esgg < "20260908"
  67. fiat-p256
  68. frama-c
  69. fred
  70. frenetic
  71. fstar
  72. gapi-ocaml
  73. gdbprofiler
  74. gendarme-json < "0.4.0"
  75. gendarme-yojson
  76. github
  77. github-data
  78. github-unix < "4.5.1"
  79. gitlab
  80. gmocoin
  81. goblint-cil >= "1.8.0"
  82. gopcaml-mode-merlin < "0.0.6"
  83. graphql
  84. graphql-async >= "0.14.0"
  85. graphql-cohttp >= "0.13.0"
  86. graphql-lwt >= "0.14.0"
  87. graphql_ppx
  88. gremlin
  89. h2
  90. hacl_x25519
  91. hegel
  92. hilite < "0.3.0"
  93. hl_yaml
  94. hockmd
  95. hpack
  96. hsluv
  97. httph
  98. huml
  99. huml-cli
  100. index-bench
  101. ip2location
  102. ip2locationio
  103. irmin-graphql
  104. irmin-tezos
  105. jasmin
  106. jhupllib
  107. jose
  108. js_of_ocaml-compiler < "6.0.1"
  109. json-rpc
  110. json_decoder
  111. jsondiff
  112. jsonkit
  113. jsonrpc < "1.6.0"
  114. jsonschema
  115. jsonschema2atd
  116. jupyter
  117. jupyter-kernel
  118. jwt
  119. jwto
  120. kappa-library < "4.1.3"
  121. karamel
  122. kind2
  123. kremlin < "transition"
  124. kube
  125. kubecaml
  126. lablgtk3-extras >= "3.0.1"
  127. lambda-runtime
  128. lambdapi
  129. learn-ocaml
  130. letsencrypt < "2.0.0"
  131. letters
  132. libsail
  133. lichess_api
  134. linol >= "0.2"
  135. linol-eio
  136. linol-lwt
  137. lsp
  138. melange-json = "1.2.0"
  139. melange-json-native
  140. merlin = "4.5-411"
  141. miaou-core
  142. miaou-driver-web
  143. mirage-crypto-ec
  144. monorobot
  145. mopsa
  146. morbig
  147. nats-client
  148. nats-client-async >= "0.0.10"
  149. nloge
  150. nsq
  151. obuilder
  152. ocaml-lsp-server
  153. ocaml-protoc-plugin >= "6.1.0"
  154. ocaml-protoc-yojson
  155. ocaml_db_model
  156. ocaml_pgsql_model
  157. ocf
  158. ocsigen-start
  159. odoc = "2.1.1"
  160. oframl
  161. oidc
  162. ojs-base
  163. ojs_base
  164. ometrics < "0.2.0"
  165. opam-check-npm-deps >= "4.1.0"
  166. openai-gym
  167. openapi < "1.0.0"
  168. openapi_router
  169. openstellina
  170. opium >= "0.19.0"
  171. oraft
  172. orun
  173. osh
  174. oui
  175. ozulip
  176. pa_ppx < "0.19"
  177. pbrt_yojson
  178. pds-reachability
  179. pgn_parser
  180. phylogenetics >= "0.2.0"
  181. pkcs11
  182. pkcs11-driver >= "1.0.0"
  183. playwright
  184. plist
  185. podge
  186. ppx_deriving_jsonschema
  187. ppx_deriving_yojson
  188. ppx_hegel_test
  189. ppx_protocol_conv_json
  190. ppx_yojson
  191. ppx_yojson_conv_lib
  192. prof_spacetime
  193. qmp
  194. quests
  195. r2pipe
  196. radare2
  197. rdf < "1.0.0"
  198. records
  199. repr-bench
  200. rescriptdep
  201. rpclib
  202. rungen
  203. SZXX
  204. safemoney
  205. sail < "0.15"
  206. satyrographos
  207. savvy
  208. semver2
  209. sentry
  210. sihl < "0.2.0" | >= "0.3.0~rc2"
  211. sihl-core
  212. simple_httpd
  213. slack
  214. slacko
  215. slug
  216. smtml >= "0.7.0"
  217. snf_mcp
  218. sosie
  219. soteria
  220. spectrum_palette_ppx
  221. spotify-web-api
  222. sqlgg >= "20260721"
  223. stitch
  224. swagger
  225. tdigest < "2.1.0"
  226. telegraml
  227. textmate-language >= "0.3.0"
  228. textrazor
  229. tidy_email_sendgrid
  230. timedesc < "0.8.0"
  231. timedesc-json
  232. timere < "0.4.0"
  233. user-agent-parser
  234. vecosek
  235. vecosek-scene
  236. vercel
  237. vscoq-language-server < "2.3.3"
  238. vsrocq-language-server
  239. wamp < "1.0"
  240. wamp-yojson
  241. webauthn
  242. why3find
  243. xapi-rrd >= "1.9.0"
  244. yultracer
  245. zarr

Conflicts

None