open-rpc / spec

The OpenRPC specification
https://spec.open-rpc.org
Apache License 2.0
165 stars 49 forks source link

Allow "$schema" at root #322

Closed ricktaylor closed 3 years ago

ricktaylor commented 3 years ago

A lot of modern editors (e.g. VSCode) will pick up on a "$schema" prpperty at the root of a JSON document and provide auto-completion.

However, "$schema" is not valid in the root of an OpenRPC spec. (Ironically by adding the "$schema" element, VSCode then correctly tells me it's not allowed!)

What are the problems around adding "$schema" : { "const": "https://meta.open-rpc.org/" } or something similar to the spec?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

BelfordZ commented 3 years ago

@ricktaylor thanks for the issue.

Not a bad idea. It would replace the need for editor plugins (theres one for vscode that does pretty much exactly this). I'll have to think about how it can be mentioned in the spec. As for the metaschema, it would be simple to add.

Any objections or ideas @shanejonas @zcstarr ?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.