{"id":15010943,"url":"https://github.com/juspay/medea","last_synced_at":"2025-04-09T18:35:13.324Z","repository":{"id":56846776,"uuid":"263654364","full_name":"juspay/medea","owner":"juspay","description":"A JSON schema language","archived":false,"fork":false,"pushed_at":"2021-05-12T20:45:04.000Z","size":311,"stargazers_count":25,"open_issues_count":10,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-09-20T07:55:20.236Z","etag":null,"topics":["haskell","json","schema","validator"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/juspay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T14:31:04.000Z","updated_at":"2022-12-14T16:53:52.000Z","dependencies_parsed_at":"2022-09-09T01:00:41.331Z","dependency_job_id":null,"html_url":"https://github.com/juspay/medea","commit_stats":null,"previous_names":[],"tags_count":5,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fmedea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fmedea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fmedea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juspay%2Fmedea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juspay","download_url":"https://codeload.github.com/juspay/medea/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088371,"owners_count":21045700,"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","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":["haskell","json","schema","validator"],"created_at":"2024-09-24T19:37:40.967Z","updated_at":"2025-04-09T18:35:13.305Z","avatar_url":"https://github.com/juspay.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Medea\n\n## What is this?\n\nMedea is a schema language for JSON document structure. It is similar to [JSON\nSchema][json-schema], but is designed to be simpler and more self-contained.\n\nThis repo contains both a specification (in ``SPEC.md``) and a reference\nimplementation (in Haskell). We also have a [PureScript implementation available][medea-ps].\n\nMedea is named after [Jason's wife][medea]. Additionally, the name reflects the\ntensions between Jason and Medea as told in the legends, as told by the\n[implementer of ``medea-ps``][ben]:\n\n\u003e \"I'm not sure if the name is because it loves JSON, or murdered all of JSON's kids\n\u003e and flew away in a chariot pulled by dragons.\"\n\n## Why Medea?\n\nSince JSON Schema exists, and has gone through a range of revisions, why does\nMedea exist? There are several reasons for this, which we summarize below.\n\n### The JSON Schema standard is complex\n\nThe current version of the JSON Schema standard (the 2019-09 draft at the time\nof writing) is _highly_ complex. It, along with its adjacent standards, covers\nconsiderably more than simply validating JSON documents. It also includes:\n\n* A MIME type for schema files\n* Meta-schema information, including URI-based stuff\n* Lexical and dynamic scope of keywords\n* Sub-schemata and rules they follow\n* Output formatting\n* How to identify schemata via media type parameters\n\nNote that this is _before_ we get to anything to do with validating JSON! It is\nperhaps unsurprising that no Haskell package exists which complies with the\ncurrent standard. Thus, we would have to develop something 'from scratch' in any\ncase.\n\nFor our purposes, none of this was needed - we simply wanted to have a way to\ndescribe the valid structure of a JSON document in textual form, and have a way\nto use it as a cross-language tool for validating the structure of JSON. Medea\nfocuses on this, and _only_ this.\n\n### JSON Schema requires arbitrary URI resolution\n\nDue to the design of JSON Schema, schemata themselves have (meta) schemata.\nThese are indicated by use of URIs. Additionally, schemata can include other\nschemata, in several different ways, _also_ indicating this by URIs. These URIs\ncan aim at basically arbitrary locations; in fact, multiple examples in the\nstandard(s) specify online locations where such information can be found.\n\nThis essentially means that a compliant validator must be able to follow\n_arbitrary_ URIs, or give users the ability to direct the validator. This isn't\neven needed for _validation itself_ - we might need to do this just to know what\nthe schema is! Furthermore, as canonical examples require us to fetch\ninformation from online (or have a means of users directing us there), any\nvalidator we create would need to support fetching data from the Internet. \n\nWhile this can be useful, it puts considerable complexity on the part of both\nthe validator and the user. The use case that prompted the creation of Medea\ndidn't (and still doesn't) warrant this degree of complexity. This is not merely\na question of implementation time or dependency weight - it is also an issue of\ncorrectness and usability. The design of Medea deliberately limits this - all\nschemata are single, self-contained files. How these files are obtained, and\naimed at, is left to the user; if they need to fetch these from a remote\nlocation or not should not be Medea's concern (and isn't).\n\n## Getting started \n\nFor an easy starting point, check out ``TUTORIAL.md``, which describes basic usage\nof Medea, with examples. For a more detailed description of Medea's capabilities\nand schema language, ``SPEC.md`` has you covered. \n\nWe also provide a collection of Medea schema files, designed for conformance\ntesting, in the ``conformance`` directory.\n\n## What does Medea work on?\n\nWe support every major GHC version from 8.6 onwards, for its most current minor\nversion. At the moment, this means:\n\n* 8.6.5\n* 8.8.4\n* 8.10.2\n\nWe support both Stack and Cabal (v2) builds. We aim to be cross-platform where\npossible - if the dependencies work on the platform, Medea should too.\n\n## License\n\nMedea's specification, as well as the Haskell (and PureScript) reference\nimplementations, are under the MIT license. Please see ``LICENSE.md`` for more\ninformation.\n\n[json-schema]: https://en.wikipedia.org/wiki/JSON#JSON_Schema \n[medea-ps]: https://github.com/juspay/medea-ps\n[json-schema-validators]: https://json-schema.org/implementations.html#validators\n[medea]: https://en.wikipedia.org/wiki/Medea\n[ben]: https://github.com/Benjmhart\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuspay%2Fmedea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuspay%2Fmedea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuspay%2Fmedea/lists"}