{"id":15607929,"url":"https://github.com/oada/formats","last_synced_at":"2025-08-23T15:10:35.796Z","repository":{"id":37896340,"uuid":"254252304","full_name":"OADA/formats","owner":"OADA","description":"Simplified approach to OADA formats that actually uses JSON Schema","archived":false,"fork":false,"pushed_at":"2024-08-24T06:49:28.000Z","size":9356,"stargazers_count":3,"open_issues_count":32,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-25T10:51:12.392Z","etag":null,"topics":["ajv","json-schema","jsonschema","oada","runtime-typechecking","schema","types","typescript"],"latest_commit_sha":null,"homepage":"https://formats.openag.io","language":"TypeScript","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/OADA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-09T02:32:25.000Z","updated_at":"2024-07-01T04:13:48.000Z","dependencies_parsed_at":"2024-05-18T00:25:55.083Z","dependency_job_id":"619a1615-abd8-4df4-b90c-40c1cac0f58e","html_url":"https://github.com/OADA/formats","commit_stats":{"total_commits":277,"total_committers":10,"mean_commits":27.7,"dds":"0.33574007220216606","last_synced_commit":"a57ed6b325245d00c7aaf24e61f6a9832bce4ca8"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Fformats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Fformats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Fformats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Fformats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OADA","download_url":"https://codeload.github.com/OADA/formats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248420665,"owners_count":21100442,"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":["ajv","json-schema","jsonschema","oada","runtime-typechecking","schema","types","typescript"],"created_at":"2024-10-03T05:05:15.491Z","updated_at":"2025-04-11T14:44:10.205Z","avatar_url":"https://github.com/OADA.png","language":"TypeScript","readme":"# OADA Formats\n\n[![License](https://img.shields.io/github/license/OADA/formats)](LICENSE)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/6a3ad756-6ef7-4b04-b603-74deef3642c9/deploy-status)](https://app.netlify.com/sites/formats/deploys)\n\n[![Deploys by Netlify](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com)\n\nThis is a mono-repo for all things relating to OADA formats. It uses yarn\nworkspaces. The purpose of this repo is to act as an inventory of known OADA API\nand ag data formats. These formats are represented as [JSON Schema][].\n\n## Schemas\n\nThe [JSON Schema][] files are publicly available from\n`https://formats.openag.io/`. The `$id` of our schemas is also the URL at which\nit is available for download (i.e., if you configure your JSON Schema tool to\nresolve `$ref`s via HTTP, you can reference our schemas with no further\neffort.). This makes the schemas/formats useful to any of the many environments\nwhich have\n[JSON Schema implementations](https://json-schema.org/implementations.html)\navailable.\n\n### A caveat about schema files\n\nTo have TypeScript sanity check the formats of our schemas for us, we wrap our\nJSON Schemas in TypeScript modules.\n\n```ts\n// Somewhat opinionated TypeScript type definitions for JSON Schema\nimport type { JSONSchema8 as Schema } from 'jsonschema8';\n\nconst schema: Schema = {\n  /* The actual JSON Schema */\n};\n\n/**\n * Simply exports an object of the schema,\n * but now TS understands what it is and how it should look.\n */\nexport = schema;\n```\n\nThe original intention was to simply have JSON files of the [JSON Schema][], but\nthe convenience of having TypeScript check our schemas for us motivated this\ncompromise. The published versions of the schemas have this wrapping removed and\nare pure [JSON Schema][].\n\n### Adding formats\n\nAll that is needed to add a format is to create a new `.schema.ts` file within\n[schemas](schemas) which exports valid JSON Schema. You can easily add the file\nfor your new format with `hygen`:\n\n```shell\nhygen format new your/format/name\n```\n\n#### Testing formats\n\nOur test suite will automatically sanity-check all formats (including your new\nones). Schemas are (among other checks) checked against the meta-schema, and\nexpected to match any examples they have.\n\nYou are _strongly encouraged_ to add [`examples`][] to your new formats.\nAdditionally, if you create a `.schema.spec.cts` file for your format, any mocha\ntests in it will run with the test suite.\n\n## JavaScript/TypeScript libraries\n\nThis project is chiefly a collection of pure [JSON Schema][] schemata, but there\nare also node libraries for utilizing the schemas in TypeScript/JavaScript under\n[packages](packages).\n\n[json schema]: https://json-schema.org\n[`examples`]: https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Fformats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foada%2Fformats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Fformats/lists"}