question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow "$schema" via schema.json

See original GitHub issue

The schema should allow the “$schema” element in the referencing document.

Sample Document

{
  "$schema": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v2.0/schema.json",
  "swagger": "2.0",
  "info": {
    "title": "My Service API",
    "version": "0.0.1"
  },
  "paths": {}
}

“Property $schema is not allowed.”

{
	"resource": "/Users/gpalacino/Source/play/service/service-api/openapi.json",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": null,
	"severity": 4,
	"message": "Property $schema is not allowed.",
	"startLineNumber": 2,
	"startColumn": 3,
	"endLineNumber": 2,
	"endColumn": 12
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
handrewscommented, Oct 19, 2018

$schema is a JSON Schema keyword, and OAS is not, itself a JSON Schema (it is a document that contains JSON Schemas within it). While some people do use a $schema property in JSON documents the same way that JSON Schema uses it, this is not actually any sort of standard and is, IMHO, more confusing than helpful.

0reactions
handrewscommented, Sep 26, 2019

[EDIT: I misread this and didn’t realize it was about putting $schema at the root of OAS itself. I’ve taken out what I wrote before and will put that in a separate issue.]

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started Step-By-Step - JSON Schema
To start a schema definition, let's begin with a basic JSON schema. We start with four properties called keywords which are expressed as...
Read more >
JSON Schema Examples Tutorial - MongoDB
This JSON schema tutorial will walk through the basics of setting JSON schema standards and using schema for validation in MongoDB Atlas and...
Read more >
JSON - Schema - Tutorialspoint
JSON - Schema, JSON Schema is a specification for JSON based format for defining the structure of JSON data. It was written under...
Read more >
How to Validate Your JSON Using JSON Schema
JSON Schema is a JSON-based format for defining the structure of JSON data. It provides a contract for what JSON data is required...
Read more >
Introduction to JSON Schema in Java - Baeldung
JSON Schema is a declarative language for validating the format and structure of a JSON Object. It allows us to specify the number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found