Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction with JSON Schema project? #23016

Closed
Relequestual opened this issue Mar 22, 2017 · 19 comments
Closed

Interaction with JSON Schema project? #23016

Relequestual opened this issue Mar 22, 2017 · 19 comments
Assignees
Labels
engineering VS Code - Build / issue tracking / etc. *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@Relequestual
Copy link

Hi VSCode team!

It's great to see you support JSON Schema out of the box.
I also discovered you use JSON Schema as part of your configuration files.

I'm part of the team working on JSON Schema. Is anyone from MS interested in helping shape the future of the specification? If so, let's open a dialogue!

Currently it's a pretty small team, and I'd like to rally support from a few of the big companies that are using or might be interested in JSON Schema. We can push it through to RFC together. =]

@egamma egamma assigned aeschli and unassigned aeschli Mar 27, 2017
@aeschli
Copy link
Contributor

aeschli commented Apr 3, 2017

@Relequestual Hi Ben, yes, JSON schemas are used heavily in VSCode for settings and several other configuration files and its the backbone of our JSON editing experience.
We'd be happy if you can loop us in the discussions on the future of the JSON schema. I can't speak for Microsoft, but at least for the VSCode team.

Not sure if you have seen, in VSCode we support some simple custom extensions to JSON schemas to improve the JSON editing experience:

  • patternErrorMessage: a custom error message shown when a pattern does not match
{
	"type": "string",
	"pattern": "^#([0-9A-Fa-f]{2}){3,4}$",
	"patternErrorMessage": "Invalid color format. Use #RRGGBB or #RRGGBBAA"
}
  • deprecationMessage: if present this marks a property as deprecated and the given message will be shown to the user
{
	"type": "object",
	"properties": {
		"foo": {
			"type": "string",
			"deprecationMessage": "This property is deprecated. Use the 'bar' property instead."
		},
		"bar" : {
		}
	}
}
  • enumDescriptions: descriptions for enum values
{
	"type": "object",
	"properties": {
		"wrapAttributes": {
			"enum": [
				"auto",
				"force",
				"force-aligned"
			],
			"enumDescriptions": [
				"Wrap attributes only when line length is exceeded.",
				"Wrap each attribute except first.",
				"Wrap each attribute except first and keep aligned."
			]
		}
	}
}

@Relequestual
Copy link
Author

Hey @aeschli, Great!
Developments are happening quite rapidly over on the json-schema-org repos.
I appreciate you can't speak for ALL of MS, but representing them at any level could be useful for the project moving forward. Swagger for example has a lot of names behind it, but few realise that a LOT of its core is actualy JSON Schema.

We're currently reviewing and trying to fix a few things from our pre-relesase a week or so ago, and planning to put out draft-6 soonish. If yourself or someone from your team would like to be represented on the project, I'm planning to create a team soon of collaborators.

It's great you've already used a few extensions you've created. It would be nice to hear about them in detail; I'm sure some members of the team will have implementation questions. Working code carries weight.

I'll be sure to keep you posted. If you're happy, I'll include yourself in the new company collaborators team.

Thanks.

@egamma egamma added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Apr 20, 2017
@kieferrm kieferrm added the engineering VS Code - Build / issue tracking / etc. label Apr 24, 2017
@Relequestual
Copy link
Author

Hey there. Thought I'd touch base with this one. I've taken a little more of a back seat recently, and will be for a while, but I''d still like to see if we can get a few companies commit to JSON Schema, and hopefully provide some level of resources in terms of peoples time.

I notice MS are a member or sponsor of the Open API Initiative (although the website is a bit of a joke right now). That actually uses JSON Schema as a base for object definitions, and based on our interactions, are happy for us to continue leading that aspect of the project. Since JSON Schema is more cross cutting than just APIs, that's even more reason to support it in some capacity.

Is there anyone you can at minimal float the concept of spending some time on JSON Schema? Mention it in a team meaning or something? I may have a few contacts I could try and work, but I'd rather try to collaborate organicaly.

@lijunle
Copy link
Member

lijunle commented Aug 1, 2017

Hi, @Relequestual

JSON schema now provides another way to show enum description. Are you going to support it?

{
    "oneOf": [
        {"const": "foo", "title": "Pick Foo"},
        {"const": "bar", "title": "Pick Bar"},
        {"const": "whatever", "title": "Don't Care"}
    ]
}

@Relequestual
Copy link
Author

@lijunle I'm not sure I understand your question? Is "what" going to support "what"?

@Relequestual
Copy link
Author

Hi there. I thought I'd come back and see if there's been any further though given to making some time for working with JSON Schema. We're close to finishing off the next draft and will start scoping again soon.

@lijunle I'm still not sure I understand your question at all, sorry. Could you expand?

@aeschli Is there anyone who wants to make issues for our next draft scoping? or even review and feedback on the soon to be published draft? It's a shame I can't get any "official" levels in sense of "used by microsoft" type sticker for JSON Schema.

@handrews
Copy link

handrews commented Sep 6, 2017

@lijunle what you show is in the standard, so it's just a question of implementations catching up. Some have already, which you can see on the software page. You can search the page for "draft 6" without quotes to see what has added support so far. And I know several other implementations are working on it.

@handrews
Copy link

handrews commented Sep 6, 2017

@aniljava @aeschli in case it's not clear, @Relequestual and I are working on the JSON Schema specification, not a specific implementation.

@lijunle
Copy link
Member

lijunle commented Sep 6, 2017

Hi, @handrews

Then, that is interesting. does the enumDescriptions ever a part of the JSON schema standard.

We are writing some JSON schema files, we have two choices. The first one is using enumDescriptions, another is using oneOf. I saw that oneOf is a part of standard, it looks make sense to use oneOf instead of enumDescriptions. However, VSCode does not support oneOf, but support enumDescriptions. IMO, using something not part of the standard is not a good smell.

Hope I explain the things clearly.

@lijunle
Copy link
Member

lijunle commented Sep 6, 2017

@handrews @Relequestual In case it is not clear, I am a Microsoft employee, but not for VSCode team. I hope to see VSCode is following JSON schema spec too. ❤️

@handrews
Copy link

handrews commented Sep 6, 2017

@lijunle we decided to recommend const + oneOf instead of adding a new enumDescriptions keyword: json-schema-org/json-schema-spec#57

In draft-07 we are introducing if/then/else which will allow replacing a lot of uses of oneOf with something a bit more intuitive. oneOf is designed for mutually exclusive validation schemas, but it gets pressed into service as a conditional. So we are adding support for explicit conditionals. So your example could be rewritten as follows in draft-07:

{
    "allOf": [
        {"enum": ["foo", "bar", "whatever"]},
        {"if": {"const": "foo"}, "then": {"title": "Pick Foo"}},
        {"if": {"const": "bar"}, "then": {"title": "Pick Bar"}},
        {"if": {"const": "whatever"}, "then": {"title": "Don't Care"}}
    ]
}

This is a little more verbose but (I hope) very intuitive to read. I have found more tools support "allOf" than "oneOf" and we hope that "if"/"then"/"else" prove to be easier for tools to reason about than "oneOf". Feedback on the PR is welcome- it will be open for comment for at least four more days (more if a major concern is raised).

I haven't looked at VSCode (@Relequestual just pointed me to this issue today), so I need to take a closer look at how you are using and supporting it.

@kieferrm
Copy link
Member

This discussion should move to https://github.com/json-schema-org/json-schema-spec.

@Relequestual
Copy link
Author

@kieferrm Shall I open a new issue here for the VS Code team to log issues / questions on the json-schema-spec repo for each extension they have created and currently use?

This issue was trying to discover if the VS Code team would interact with JSON Schema and it's developments, feeding back on releases etc. Are there any specific people that could be assigned such a role?

@handrews
Copy link

@kieferrm It's not clear to me (nor, apparenty, @Relequestual) what needs to be moved from here over to our (json-schema-org/json-schema-spec) repository. Could you be a bit more specific?

@kieferrm
Copy link
Member

kieferrm commented Dec 6, 2017

Since summer you (JSON schema maintainers I suppose) discuss among each other. There is no reason for this to happen here.

@Relequestual
Copy link
Author

@kieferrm You have 100% missed the point of this issue. This issue is not about any part of JSON Schema. This issue is asking the VS Code team if they want to help SHAPE JSON Schema, given they are using it, in a very popular tool.

@kieferrm
Copy link
Member

See #23016 (comment).

@Relequestual
Copy link
Author

@kieferrm So you're saying that the VSCode team have no interest in how JSON Schema develops, despite heavily using it?

@philsturgeon
Copy link

@kieferrm Hey yeah woah there, can I raise the "misunderstanding flag" for one moment? @Relequestual was trying to field feedback and strike up some form of communications with Microsoft / VSCode, to make sure your requirements and use cases are aware to the JSON Schema contributors.

As VSCode uses JSON Schema, it would be horrible for a future version to deprecate or remove something you require, so having input from you folks would be fantastic.

It seemed like @aeschli was going to talk about it a bit, but then the topic got sidelined by @lijunle asking specific questions about a certain thing in JSON Schema. Those responses should have redirected folks to the JSON Schema Slack (or anywhere else), but @kieferrm could you please avoid shoving people away who are just trying to field feedback from a project they respect?

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc. *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

8 participants
@philsturgeon @egamma @Relequestual @lijunle @handrews @kieferrm @aeschli and others