diff --git a/.github/workflows/validate-tooling-data.yml b/.github/workflows/validate-tooling-data.yml new file mode 100644 index 000000000..5ec227928 --- /dev/null +++ b/.github/workflows/validate-tooling-data.yml @@ -0,0 +1,61 @@ +name: Validate Tooling Data + +on: + push: + paths: + - data/tooling-data.yaml + branches: + - main + pull_request: + paths: + - data/tooling-data.yaml + workflow_dispatch: + +jobs: + validate-tooling-data: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Corepack enable + run: corepack enable + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: yarn add ajv ajv-formats js-yaml + + - name: Validate tooling-data.yaml + run: | + node -e " + const Ajv = require('ajv/dist/2020'); + const addFormats = require('ajv-formats'); + const path = require('path'); + const fs = require('fs'); + const yaml = require('js-yaml'); + const dataDir = path.join(process.env.GITHUB_WORKSPACE, 'data'); + const schemaPath = path.join(dataDir, 'tooling-data.schema.json'); + const dataPath = path.join(dataDir, 'tooling-data.yaml'); + + try { + const schema = JSON.parse(fs.readFileSync(schemaPath, 'utf-8')); + const data = yaml.load(fs.readFileSync(dataPath, 'utf-8')); + const ajv = new Ajv({ allErrors: true }); + addFormats(ajv); + const validate = ajv.compile(schema); + const valid = validate(data); + if (!valid) { + console.error('Validation failed:', validate.errors); + process.exit(1); + } else { + console.log('tooling-data.yaml is valid.'); + } + } catch (error) { + console.error('Error validating tooling-data.yaml:', error); + process.exit(1); + }" diff --git a/data/tooling-data.schema.json b/data/tooling-data.schema.json new file mode 100644 index 000000000..9896ae411 --- /dev/null +++ b/data/tooling-data.schema.json @@ -0,0 +1,286 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "JSON Schema Tooling Data Document", + "description": "This is a schema which represents the JSON Schema Tooling Data Document", + "$defs": { + "persons": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "name": { + "description": "The persons name, should they wish to provide it", + "type": "string" + }, + "email": { + "description": "" + }, + "username": { + "description": "The persons username on the platform where the user exists", + "type": "string" + }, + "platform": { + "type": "string", + "anyOf": [ + { + "enum": ["github", "gitlab", "bitbucket"] + }, + { + "description": "A string value not yet included in the list of platforms" + } + ] + }, + "additionalProperties": false + }, + "additionalProperties": false + } + } + }, + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the project", + "type": "string" + }, + "description": { + "description": "A brief description of the project", + "$comment": "If this is omitted and description is already defined on GitHub or GitLab for the repository, we will use that information.", + "type": "string" + }, + "toolingTypes": { + "description": "The categories of tooling for the project", + "type": "array", + "uniqueItems": true, + "items": { + "description": "One of the categories of tooling of the project", + "type": "string", + "enum": [ + "validator", + "hyper-schema", + "benchmarks", + "documentation", + "LDO-utility", + "code-to-schema", + "data-to-schema", + "model-to-schema", + "schema-to-types", + "schema-to-code", + "schema-to-web-UI", + "schema-to-data", + "util-general-processing", + "util-schema-to-schema", + "util-draft-migration", + "util-format-conversion", + "util-testing", + "editor", + "editor-plugins", + "schema-repository", + "linter", + "linter-plugins" + ] + } + }, + "languages": { + "description": "The language or languages a tool is built in. In the case of a validator, this will likely be the language it is written in. In the case of a conversion or transformation tool, these are the languages that are supported in some capacity.", + "type": "array", + "items": { + "description": "Individual language name, from the list unless not included.", + "type": "string", + "anyOf": [ + { + "enum": [ + [ + "Common Lisp", + "Rust", + "Elm", + ".NET", + "PHP", + "Clojure", + "Helm", + "Python", + "XSD", + "Scala", + "Orderly", + "Kotlin", + "Elixir", + "RAML", + "Erlang", + "Java", + "Lua/LuaJIT", + "OpenAPI", + "Perl", + "TypeScript", + "Ruby", + "Objective-C", + "Swift", + "C#", + "Go", + "C++", + "JavaScript" + ] + ] + }, + { + "description": "A string value not yet included in the list of languages" + } + ] + } + }, + "environments": { + "description": "The platforms or environments in which the tool or library is designed to operate. This field is optional and should be included when the tool or library is specific to a certain platform or environment.", + "type": "array", + "items": { + "type": "string", + "anyOf": [ + { + "enum": [ + "Web (Online)", + "GitHub Actions", + "Command Line", + "COM/ActiveX" + ] + }, + { + "description": "A string value not yet included in the list of environments" + } + ] + } + }, + "dependsOnValidators": { + "description": "Documents if the tool is the primary validator provider or depends on another tool", + "type": "array", + "items": { + "description": "One of the tools that this tool depends upon", + "$comment": "This should be the source URL. The source URL should already be known to the ecosystem repository in some way.", + "type": "string", + "format": "uri" + } + }, + "creators": { + "description": "The creators or authors of the project", + "$ref": "#/$defs/persons" + }, + "maintainers": { + "description": "The maintainers of the project", + "$ref": "#/$defs/persons" + }, + "license": { + "description": "The license under which the project is distributed. SPDX expressions or a URL.", + "$comment": "Schemastore package.json schema uses enum to assist in auto complete. Could be worth doing the same.", + "type": "string" + }, + "source": { + "description": "The URL of the project's repository", + "type": "string", + "format": "uri" + }, + "homepage": { + "description": "The URL of the project's homepage", + "type": "string", + "format": "uri" + }, + "documentation": { + "$comment": "This is reserved for future use", + "type": "object" + }, + "supportedDialects": { + "description": "The declared supported dialects of JSON Schema. This includes draft version identifiers.", + "type": "object", + "properties": { + "draft": { + "description": "An array of dialects of JSON Schema.", + "type": "array", + "items": { + "enum": [1, 2, 3, 4, 5, 6, 7, "2019-09", "2020-12"] + } + }, + "additional": { + "description": "Additional Dialects that are supported beyond the ones defined by the JSON Schema project, such as the OpenAPI Dialect.", + "type": "array", + "items": { + "description": "Individual JSON Schema Dialect items", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "homepage": { + "type": "string", + "format": "uri" + }, + "source": { + "type": "string", + "format": "uri" + } + }, + "required": ["name", "source"], + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "bowtie": { + "description": "Information related to compliance testing by Bowtie - https://bowtie.report - Presence of this property implies the tool is being tested in Bowtie", + "type": "object", + "properties": { + "identifier": { + "description": "The identifier used for the tool in Bowtie, including the language.", + "examples": ["dotnet-jsonschema-net", "js-ajv"] + } + }, + "required": ["identifier"], + "additionalProperties": false + }, + "toolingListingNotes": { + "description": "Notes about the tooling which will appear in the tooling listing on the website.", + "type": "string" + }, + "compliance": { + "description": "Details on what must be done to make the implementation the most compliant that it can be. This is displayed on the website with the tooling details", + "type": "object", + "properties": { + "config": { + "type": "object", + "properties": { + "docs": { + "description": "A URL which links to the documentation which explains how to follow the given instructions.", + "type": "string" + }, + "instructions": { + "description": "Instructions on how to make the implementation the most compliant.", + "type": "string" + } + } + } + } + }, + "landscape": { + "description": "Additional information that should be used when generating the JSON Schema landscape diagram - https://github.com/json-schema-org/landscape", + "type": "object", + "properties": { + "logo": { + "description": "The filename of the logo to use for the JSON Schema landscape diagram - Must be included in the landscape repo under the logos directory, and in SVG format.", + "type": "string" + }, + "optOut": { + "description": "Set this value to a boolean `true` value if you do not wish to be included in the JSON Schema Landscape. If you do, we would like to hear why.", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "lastUpdated": { + "description": "The date when the tool was most recently updated. The date should be in the format YYYY-MM-DD, representing the year, month, and day of the update.", + "type": "string", + "format": "date" + } + }, + "required": ["name", "toolingTypes"], + "additionalProperties": false + } +} diff --git a/data/tooling-data.yaml b/data/tooling-data.yaml index 6def41525..63ec67369 100644 --- a/data/tooling-data.yaml +++ b/data/tooling-data.yaml @@ -27,8 +27,8 @@ source: 'https://github.com/JamesNK/Newtonsoft.Json.Schema' homepage: 'https://www.newtonsoft.com/jsonschema' supportedDialects: - draft: [3, 4, 6, 7, '2019-09'] - lastUpdated: '2022-08-31' + draft: [3, 4, 6, 7, '2019-09', '2020-12'] + lastUpdated: '2024-06-08' - name: Corvus.JsonSchema description: 'Support for Json Schema validation and entity generation' @@ -400,7 +400,7 @@ lastUpdated: '2022-08-31' - name: json-schema (dev.harrel) - description: 'JSON schema validation library written in Java' + description: 'JSON schema validation library written in Java. It can be used with all major JSON libraries (Jackson, GSON, JSON.org and more) and is open for customizations.' toolingTypes: ['validator'] languages: ['Java'] maintainers: @@ -411,9 +411,8 @@ source: 'https://github.com/harrel56/json-schema' homepage: 'https://harrel.dev/json-schema' supportedDialects: - draft: [2019-09, 2020-12] - toolingListingNotes: 'JSON library agnostic implementation. Supports custom keywords.' - lastUpdated: '2023-11-12' + draft: [7, 2019-09, 2020-12] + lastUpdated: '2024-08-14' bowtie: identifier: 'java-json-schema' @@ -478,10 +477,10 @@ homepage: 'https://npmjs.com/@exodus/schemasafe' supportedDialects: draft: [4, 6, 7, 2019-09, 2020-12] - toolingListingNotes: | - For Node.js and browsers, with security and speed being the main focus. Pre-compiles schemas to JS functions. + toolingListingNotes: + 'For Node.js and browsers, with security and speed being the main focus. Pre-compiles schemas to JS functions. [Supports OpenAPI `discriminator`](https://github.com/ExodusMovement/schemasafe/blob/master/doc/Discriminator-support.md). - Default behavior is hardened with additional schema coherence validation. + Default behavior is hardened with additional schema coherence validation.' lastUpdated: '2023-08-29' bowtie: identifier: 'js-schemasafe' @@ -518,7 +517,7 @@ platform: 'github' license: 'MIT' source: 'https://github.com/cfworker/cfworker/blob/master/packages/json-schema/README.md' - homepage: 'cfworker.dev' + homepage: 'https://cfworker.dev' supportedDialects: draft: [7, 4, 2019-09, 2020-12] toolingListingNotes: 'Built for Cloudflare workers, browsers, and Node.js' @@ -535,7 +534,7 @@ license: 'MIT' source: 'https://github.com/sagold/json-schema-library' supportedDialects: - draft: [7, 6, 4] + draft: [7, 6, 4, 2019-09] toolingListingNotes: 'Built for Node.js and browsers. Customizable json-validator and json-schema utilities for traversal, data generation and validation' lastUpdated: '2022-08-31' @@ -1096,6 +1095,22 @@ toolingListingNotes: 'can be used with YAML and many other formats besides JSON' lastUpdated: '2022-08-31' +- name: Sourcemeta JSON Schema CLI + description: The CLI for working with JSON Schema. Covers formatting, linting, testing, bundling, and more for both local development and CI/CD pipelines + toolingTypes: ['validator'] + environments: ['Command Line'] + dependsOnValidators: ['https://github.com/sourcemeta/jsontoolkit'] + maintainers: + - name: 'Juan Cruz Viotti' + username: 'jviotti' + platform: 'github' + license: 'AGPL-3.0' + source: 'https://github.com/sourcemeta/jsonschema' + supportedDialects: + draft: [1, 2, 3, 4, 5, 6, 7, 2019-09, 2020-12] + toolingListingNotes: 'Supports formatting, linting, bundling, testing, validating, and more. As an exception, validation is not supported on Draft 3 and older' + lastUpdated: '2024-08-08' + - name: Validate JSON Action description: 'A Github action for validating JSON.' toolingTypes: ['validator'] @@ -1457,6 +1472,21 @@ draft: [6] lastUpdated: '2024-05-31' +- name: JSON Toolkit + description: 'JSON Toolkit is a swiss-army knife library for expressive JSON programming in modern C++' + toolingTypes: ['validator', 'util-general-processing'] + languages: ['C++'] + maintainers: + - name: 'Juan Cruz Viotti' + username: 'jviotti' + platform: 'github' + license: 'AGPL-3.0 and Commercial' + source: 'https://github.com/sourcemeta/jsontoolkit' + supportedDialects: + draft: [4, 6, 7, '2019-09', '2020-12'] + toolingListingNotes: 'Comes with its own JSON parser' + lastUpdated: '2024-06-13' + - name: Dataspecer description: 'Generates JSON Schema (and JSON-LD context) from conceptual model.' toolingTypes: ['model-to-schema'] @@ -1903,8 +1933,8 @@ toolingTypes: ['util-general-processing'] languages: ['JavaScript'] maintainers: - username: 'BigstickCarpet' - platform: 'github' + - username: 'BigstickCarpet' + platform: 'github' license: 'MIT' source: 'https://github.com/BigstickCarpet/json-schema-ref-parser' @@ -1933,8 +1963,8 @@ toolingTypes: ['util-general-processing'] languages: ['JavaScript'] maintainers: - username: 'jdesrosiers' - platform: 'github' + - username: 'jdesrosiers' + platform: 'github' license: 'MIT' source: 'https://github.com/jdesrosiers/json-schema-core' @@ -1950,8 +1980,8 @@ toolingTypes: ['util-schema-to-schema'] languages: ['JavaScript'] maintainers: - username: 'mokkabonna' - platform: 'github' + - username: 'mokkabonna' + platform: 'github' license: 'MIT' source: 'https://github.com/mokkabonna/json-schema-merge-allof' @@ -1960,8 +1990,8 @@ toolingTypes: ['util-schema-to-schema'] languages: ['JavaScript'] maintainers: - username: 'mokkabonna' - platform: 'github' + - username: 'mokkabonna' + platform: 'github' license: 'MIT' source: 'https://github.com/mokkabonna/json-schema-compare' @@ -2219,6 +2249,17 @@ draft: [3, 4, 7, 2020-12] toolingListingNotes: 'With some limitations, supports draft-3, draft-4, draft-7, and 2020-12.' +- name: jsonschema-markdown + description: 'Generate markdown documentation based on a JSON Schema document' + toolingTypes: ['documentation'] + maintainers: + - name: 'Elisiário Couto' + username: 'elisiariocouto' + platform: 'github' + license: 'MIT' + source: 'https://github.com/elisiariocouto/jsonschema-markdown' + toolingListingNotes: 'Can be used as a CLI or as a Python library.' + - name: SchemaStore.org description: 'Validate against common JSON Schemas.' toolingTypes: ['schema-repository'] @@ -2280,3 +2321,32 @@ supportedDialects: draft: [7] lastUpdated: '2022-08-31' + +- name: dadav/helm-schema + description: 'Generate _values.schema.json_ from Helm _values.yaml_; compatible with [helm-docs](https://github.com/norwoodj/helm-docs) comments.' + toolingTypes: ['data-to-schema'] + languages: ['Helm'] + maintainers: + - name: 'Daniel' + username: 'dadav' + platform: 'github' + license: 'MIT' + source: 'https://github.com/dadav/helm-schema' + supportedDialects: + draft: [7] + lastUpdated: '2024-09-03' + +- name: v8r + description: 'Uses [Schema Store](https://www.schemastore.org/) to detect a suitable schema for your input files based on the filename.' + toolingTypes: ['validator'] + environments: ['Command Line'] + dependsOnValidators: ['https://github.com/ajv-validator/ajv'] + maintainers: + - name: 'Chris' + username: 'chris48s' + platform: 'github' + license: 'MIT' + source: 'https://github.com/chris48s/v8r' + supportedDialects: + draft: [4, 6, 7] + lastUpdated: '2024-09-03' \ No newline at end of file diff --git a/pages/tools/JSONSchemaTool.ts b/pages/tools/JSONSchemaTool.ts index 899b960cc..89c957253 100644 --- a/pages/tools/JSONSchemaTool.ts +++ b/pages/tools/JSONSchemaTool.ts @@ -8,7 +8,7 @@ export interface JSONSchemaTool { creators?: Person[]; maintainers?: Person[]; license?: string; - source: string; + source?: string; homepage?: string; documentation?: object; supportedDialects?: { @@ -39,8 +39,8 @@ export interface JSONSchemaTool { export interface Person { name?: string; email?: string; - username: string; - platform: 'github' | 'gitlab' | 'bitbucket' | string; + username?: string; + platform?: 'github' | 'gitlab' | 'bitbucket' | string; } export interface BowtieEntry { diff --git a/pages/tools/components/ToolingDetailModal.tsx b/pages/tools/components/ToolingDetailModal.tsx index e517cafed..887e3c79d 100644 --- a/pages/tools/components/ToolingDetailModal.tsx +++ b/pages/tools/components/ToolingDetailModal.tsx @@ -29,21 +29,25 @@ export default function ToolingDetailModal({ }, []); useEffect(() => { - const fetchBowtieReport = async () => { - try { - const res = await fetch( - 'https://bowtie.report/api/v1/json-schema-org/implementations', - ); - const bowtieReport: BowtieReport = await res.json(); + if (tool.source) { + const fetchBowtieReport = async () => { + try { + const res = await fetch( + 'https://bowtie.report/api/v1/json-schema-org/implementations', + ); + const bowtieReport: BowtieReport = await res.json(); - setBowtieEntry(bowtieReport[tool.source] || null); - } catch (error) { - console.error('Error fetching Bowtie report:', error); - setBowtieEntry(null); - } - }; + setBowtieEntry(bowtieReport[tool.source!] || null); + } catch (error) { + console.error('Error fetching Bowtie report:', error); + setBowtieEntry(null); + } + }; - fetchBowtieReport(); + fetchBowtieReport(); + } else { + setBowtieEntry(null); + } }, [tool.source]); return (