Improve editor experience for server.json using schema#441
Conversation
Switch the server.json schema to draft-07 to get VS Code validation
I think we should continue to require it. From my experience most community servers are using stdio and it could be a somewhat safe assumption, but there are more and more moving towards http, especially ones that think beyond the local use.
I think so 👍 I expect there are examples where a server can be hosted on multiple registries of the same ecosystem, so it's safer to be specific. |
I'm going to try and get this prioritized. Many LM's are using Draft 2020 so we're going to have to support it. So I would not put too much weight on this as far as long term registry plans go. |
|
This seems incredibly sensible and I support the change! Will take a look at reviewing this properly later, please poke me if not. |
Great. I'll leave this requirement in the schema then. Low risk since it matches publish.
@rdimitrov - would you like me to update the publish endpoint to require it? I can totally do that, but it might cause a little disruption for existing server owners. IMO sooner is better than later. There is also the data back-fill to fix existing JSON in Postgres -- unless we don't care and can just wait until next update.
Thanks @connor4312. I think we should still adjust the schema for now. This is basically running in "maximum compatibility mode" until we have a good reason to update, such as needing a 2020 feature or we have data to support that consumers have moved to 2020-compatible tools/clients. I have not run into any compatibility issues with editors and Draft 7. |
I think it's probably fine to omit, if you're using the obvious default? Appreciate some benefits in being very specific, but also don't want to introduce too much friction to server developers. |
Thanks, I was slowly coming to the same conclusion. I was running the integration tests as "proof" to myself that |
Motivation and Context
Currently there are a couple shortcomings I found in the server.schema.json:
https://json-schema.org/draft/2020-12/schemawhich is unfortunately not supported by VS CodeThis means that need to round trip with the publish endpoint (perhaps spinning CI builds) to get the server.json right. It would be great if we could shift left and get indications in VS Code easier.
I propose we downgrade the schema to
http://json-schema.org/draft-07/schema#. The only difference for us is the name of$defpointers.I looked that SchemaStore and it looks like
draft-07is by far the most popular. I believe the concession of using an older schema is worth it to get VS Code editor hints.http://json-schema.org/draft-04/schema#http://json-schema.org/draft-07/schema#https://json-schema.org/draft/2019-09/schemahttps://json-schema.org/draft/2020-12/schemaOpen questions
transportactually be required? Or shouldstdiobe assumed?registry_base_urlbe required? All of the examples have it it's not required by the publish endpoint.How Has This Been Tested?
I have tried the new schema inside VS Code and I get helpful warning. For example, these are the warnings for the old schema.
I have run these:
go run .\tools\validate-examples\main.gogo run .\tools\validate-schemas\main.goBreaking Changes
I don't think these are breaking changes. I am expressing what the publish endpoint enforces at runtime.
Types of changes
Checklist
Additional context