{"id":13783746,"url":"https://github.com/juxt/jinx","last_synced_at":"2025-10-19T21:02:22.070Z","repository":{"id":44519721,"uuid":"186190593","full_name":"juxt/jinx","owner":"juxt","description":"jinx is not xml-schema (it's json-schema!)","archived":false,"fork":false,"pushed_at":"2023-03-27T22:35:40.000Z","size":698,"stargazers_count":104,"open_issues_count":11,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-28T13:38:55.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juxt.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-11T23:22:24.000Z","updated_at":"2025-02-14T09:51:39.000Z","dependencies_parsed_at":"2022-07-21T06:02:26.864Z","dependency_job_id":null,"html_url":"https://github.com/juxt/jinx","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/juxt/jinx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fjinx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fjinx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fjinx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fjinx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juxt","download_url":"https://codeload.github.com/juxt/jinx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fjinx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268171719,"owners_count":24207418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T19:00:29.947Z","updated_at":"2025-10-19T21:02:21.997Z","avatar_url":"https://github.com/juxt.png","language":"Clojure","funding_links":[],"categories":["Who Uses the Test Suite"],"sub_categories":["Clojure"],"readme":"= jinx\n\njinx is a recursive acronym: jinx is not xml-schema\n\njinx is json-schema!\n\nimage:https://img.shields.io/clojars/v/jinx.svg[\"Clojars\",link=\"https://clojars.org/jinx\"]\nimage:https://circleci.com/gh/juxt/jinx.svg?style=shield[\"CircleCI\", link=\"https://circleci.com/gh/juxt/jinx\"]\n\n== Introduction\n\nAlmost all Clojure implementations of https://json-schema.org/[json\nschema validators] wrap Java libraries. This is generally a good idea.\n\nHowever, there are some reasons why a _native_ Clojure implementation\ncan be useful:\n\n* Java libraries compile jsonschema to object graphs, making them\n  inaccessible to many of the data functions in the Clojure core\n  library.\n\n* On the front-end, it can be painful to have to convert Clojure data\n  to JavaScript objects simply for the purposes of calling a\n  jsonschema validation such as\n  https://github.com/epoberezkin/ajv[Ajv].\n\n* Extensibility: JSON Schema is designed to be extended with additional\n  vocabularies. Clojure has some nice open-for-extension mechanisms.\n\n* Size: Implementing JSON Schema is not that scary in a language as\n  nice as Clojure. There's not so much code to read, understand and\n  possibly extend.\n\n== Scope\n\nThis library implements JSON Schema 'draft7'\n(draft-handrews-json-schema-validation-01).\n\n== Status\n\nCAUTION: This is a new project, of alpha status. There may be future\nincompatible changes ahead.\n\nMost core features are working but there is more work yet to do:\n\n* Improved Error messages\n* Relative json-pointer\n* Patterns for uri-template and idn-email\n\nThis library is tested with the official\nhttps://github.com/json-schema-org/JSON-Schema-Test-Suite[JSON-Schema-Test-Suite].\n\nJSON Schema provides an official test suite, of which jinx passes all\nthe non-optional tests, and all but two of the optional tests.\n\n== Usage\n\n=== Require\n\n[source,clojure]\n----\n(require '[juxt.jinx-alpha-2 :as jinx])\n----\n\n=== Create a schema\n\n[source,clojure]\n----\n(jinx/schema {\"type\" \"array\" \"items\" {\"type\" \"string\"}})\n----\n\n=== Create a schema (short-hand)\n\n[source,clojure]\n----\n(jinx/clj-\u003ejsch ['string])\n----\n\n=== Validate a document\n\n[source,clojure]\n----\n(jinx/validate\n  {}\n  (jinx/schema {\"type\" \"object\"}))\n----\n\n== Schemas\n\nA schema is a Clojure map (or boolean) that should be augmented with\nmetadata by calling `juxt.jinx.schema/schema` on the schema data:\n\n[source,clojure]\n----\n(juxt.jinx.schema/schema {\"type\" \"object\"})\n----\n\n== Resolvers\n\nValidation can take an optional options map.\n\nThe `:resolvers` entry should be a collection of resolvers.\n\n* `:juxt.jinx.resolve/built-in` is the built-in resolver which will resolve schemas contained in the library, such as the draft7 meta-schema.\n\n* `:juxt.jinx.resolve/default-resolver` is a resolver which takes an argument of a map of URIs (or regexes) to values.\n+\nA value can be a schema (which should be pre-processed with schema metadata by calling `juxt.jinx.schema/schema`).\n+\nA value may also be a function (called with the URI or, in the case of a regex, the result of the regex match):\n+\n[source,clojure]\n----\n{#\"http://example.com/schemas/(.*)\" (fn [match] {:type \"object\"\n                                                 :path (second match)})}\n----\n\n== Developing\n\nWhen you clone this repository, use the `--recursive` option to ensure\nthat the official json schema repo is also cloned (as a submodule).\n\n----\ngit clone --recursive https://github.com/juxt/jinx\n----\n\n== Alternative implementations\n\n* https://github.com/niquola/json-schema.clj\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuxt%2Fjinx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuxt%2Fjinx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuxt%2Fjinx/lists"}