From Gary Court:

I personally use .schema.json, but there is no official file extension. The official mime type however is "application/schema+json".

Answer from Eric Hartford on Stack Overflow
๐ŸŒ
Google Groups
groups.google.com โ€บ g โ€บ json-schema โ€บ c โ€บ 05FWXoTOCdw
File extension for JSON schema documents
๎—“It is .json by convention, but nothing else prevents you from naming your schemas anything you want. What is important is the MIME type, which is set to application/schema+json (therefore a subtype of application/json).
๐ŸŒ
GitHub
github.com โ€บ json-schema-org โ€บ json-schema-spec โ€บ issues โ€บ 1130
Define the `schema.json` file-extension for application/schema+json ยท Issue #1130 ยท json-schema-org/json-schema-spec
October 4, 2021 - https://github.com/jshttp/mime-db is a widely used database of media-type <=> file-extension mappings. Notably, mime-db is used by Github Pages. So, if we can add application/schema+json <=> schema.json, then any file with a schema.json extension will be served with an application/schema+json content-type.
Author ย  jdesrosiers
๐ŸŒ
JSON Schema
json-schema.org
JSON Schema
Please visit the JSON Schema Landscape and discover more companies using JSON Schema ยท While JSON is probably the most popular format for exchanging data, JSON Schema is the vocabulary that enables JSON data consistency, validity, and interoperability at scale

From Gary Court:

I personally use .schema.json, but there is no official file extension. The official mime type however is "application/schema+json".

Answer from Eric Hartford on Stack Overflow
๐ŸŒ
MediaWiki
mediawiki.org โ€บ wiki โ€บ Manual:Extension.json โ€บ Schema
Manual:Extension.json/Schema - MediaWiki
In the future if breaking changes are made to the file format, this number will be incremented to continue supporting extensions using the older format. ... v2 provides stronger developer validation features, and is recommended if your extension already requires MediaWiki 1.29+. It is not recommended to break MediaWiki compatibility with older versions just to upgrade to a newer manifest_version. ... This field is typically placed at the bottom of extension.json ...
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ JSON
JSON - Wikipedia
March 6, 2005 - Legacy MIME types include text/json, text/x-json, and text/javascript. The standard filename extension is .json. JSON Schema specifies a JSON-based format to define the structure of JSON data for validation, documentation, and interaction control.
๐ŸŒ
JSON Schema
json-schema.org โ€บ understanding-json-schema โ€บ reference โ€บ schema
JSON Schema - Dialect and vocabulary declaration
A version of JSON Schema is called a dialect. A dialect represents the set of keywords and semantics that can be used to evaluate a schema. Each JSON Schema release is a new dialect of JSON Schema. JSON Schema provides a way for you to declare which dialect a schema conforms to and provides ...
Find elsewhere
๐ŸŒ
Cswr
cswr.github.io โ€บ JsonSchema
JSON Schema
There are several reasons to use a schema when storing data or sharing data over the Web. Some of the benefits: Filtering content: When storing files or receiving files over the web, programmers always want to ensure the data comes in the right format. JSON Schema allows for on-the-fly validation of JSON files.
๐ŸŒ
JSON Schema
json-schema.org โ€บ learn โ€บ file-system
JSON Schema - Modeling a file system with JSON Schema
In this step-by-step guide you will learn how to design a JSON Schema that mirrors the structure of an /etc/fstab file.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ json โ€บ json_schema.htm
JSON - Schema
JSON Schema is a specification for JSON based format for defining the structure of JSON data. It was written under IETF draft which expired in 2011. JSON Schema โˆ’ There are several validators currently available for different programming languages.
๐ŸŒ
JSON Schema
json-schema.org โ€บ understanding-json-schema โ€บ structuring
JSON Schema - Modular JSON Schema combination
Even though schemas are identified by URIs, those identifiers are not necessarily network-addressable. They are just identifiers. Generally, implementations don't make HTTP requests (https://) or read from the file system (file://) to fetch schemas. Instead, they provide a way to load schemas ...
๐ŸŒ
GitHub
github.com โ€บ json-schema-org โ€บ json-schema-spec โ€บ issues โ€บ 1502
File extension in $id ยท Issue #1502 ยท json-schema-org/json-schema-spec
July 30, 2023 - The JSON schema spec does not seem to put any constraints on the $id, but all the examples seem to follow a similar pattern that omits the extension, e.g.: { "$id": "/schemas/address...
Published ย  Apr 09, 2024
๐ŸŒ
Schemastore
schemastore.org
JSON Schema Store
The JSON API contains a list of JSON Schema files for known JSON file formats.
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ how do i assign a json schema to a yaml file in my custom extension?
r/vscode on Reddit: How do I assign a JSON Schema to a yaml file in my custom extension?
November 25, 2023 -

Hello everyone, I am writing a CLI tool that will have a fairly complex yaml configuration, so I wanted to create a VSCode extension to support that with completion provided by the JSON Schema and some snippets, but it seems not to work.

This is my package.json:

{
  "name": "lake-config",
  "displayName": "Lake Configuration Helper",
  "publisher": "essay97",
  "description": "Provides schema validation and snippets to configure Lake",
  "version": "0.0.1",
  "engines": {
    "vscode": "^1.80.0"
  },
  "categories": [
    "Other"
  ],
  "activationEvents": [],
  "main": "./extension.js",
  "contributes": {
    "languages": [
      {
        "id": "yaml",
        "extensions": [
          ".lake"
        ],
        "aliases": [
          "Lake Config"
        ]
      }
    ],
    "jsonValidation": [
      {
        "fileMatch": "**/*.lake",
        "url": "./lake-schema.json"
      }
    ]
  },
  "scripts": {
    "lint": "eslint .",
    "pretest": "npm run lint",
    "test": "node ./test/runTest.js"
  },
  "devDependencies": {
    "@types/vscode": "^1.84.0",
    "@types/mocha": "^10.0.3",
    "@types/node": "18.x",
    "eslint": "^8.52.0",
    "glob": "^10.3.10",
    "mocha": "^10.2.0",
    "typescript": "^5.2.2",
    "@vscode/test-electron": "^2.3.6"
  }
}

When I try to open an extension development host with F5 and open a .lake file, I get the YAML syntax highlighting, but not the JSON Schema, the bottom bar says "no json schema".

What am I missing? I even tried to set the jsonValidation.url to a random json schema from the internet to make sure it was not a problem in my schema but it's still not working.

Also: I'm not sure if I should depend on redhat.vscode-yaml. extension and what extensionDependencies does exactly.

Thanks in advance!

EDIT: I forgot one last doubt. It seems to me that snippets are bound to languages, but I don't like the idea of polluting the YAML environment with my snippets. Is there any way to define a "lake" language that inherits everything from yaml, kind of a "sub-language"?

๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
Smart JSON Schema - Visual Studio Marketplace
Extension for Visual Studio Code - Smart JSON Schema is a Visual Studio Code extension designed to simplify the generation of JSON schemas from existing JSON files. This tool is perfect for developers working with APIs, configurations, and ...
๐ŸŒ
Postman
blog.postman.com โ€บ home โ€บ what is json schema?
What Is JSON Schema? | Postman Blog
October 23, 2023 - API Specifications like the OpenAPI and AsyncAPI have embedded JSON Schema and are used extensively to validate all kinds of data, such as request headers, request and response bodies, and query and path parameters. Configuration validation: JSON is commonly used for configuration files in software ...
๐ŸŒ
JSON Schema
json-schema.org โ€บ specification
JSON Schema - Specification [#section]
Please note, additional vocabulary specific schema files are needed to fully construct and use the Core/Validation Dialect meta-schema.
๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
JSON Schema Tools - Visual Studio Marketplace
Extension for Visual Studio - Allows you to easily generate a schema file from a JSON file and generate a JSON file with dummy data based on a schema file.
๐ŸŒ
Google Groups
groups.google.com โ€บ g โ€บ json-schema โ€บ c โ€บ VBRZE3_GvbQ
Referencing a JSON schema in a JSON file
So, I would like to propose that, if a JSON file, which is not itself a schema, wishes to reference a particular schema, it could do it in an analogous way using the keyword @schema, with the value being the url of the schema. This should also be at the root.
๐ŸŒ
GitHub
github.com โ€บ miman โ€บ json-schema-viewer
GitHub - miman/json-schema-viewer: A VS Code extension to visualize JSON Schema files in an interactive, expandable tree view. ยท GitHub
A VS Code extension to visualize JSON Schema files in an interactive, expandable tree view very similar to the "OpenApi Editor".
Author ย  miman