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

Name suggestion for patternProperties #634

Closed
fkorotkov opened this issue Jul 9, 2018 · 6 comments
Closed

Name suggestion for patternProperties #634

fkorotkov opened this issue Jul 9, 2018 · 6 comments

Comments

@fkorotkov
Copy link

It will be nice to have a way to list some possible options for a pattern property so an IDE can suggest these options for completion.

@handrews
Copy link
Contributor

handrews commented Jul 9, 2018

@fkorotkov could you provide some examples of what you mean?

@fkorotkov
Copy link
Author

Sure! For example in my case, I was working on a schema for Cirrus CI: SchemaStore/schemastore#488

There I have such pattern property:

"patternProperties": {
  "(.*)task": {
    ...
  }
}

Which means there can be multiple tasks defined. Tasks like build_task, test_task, lint_task, deploy_tasks. And 99.9% of the users would use only these 4 names.

I would love to add such suggestions within a schema so editors can use them and do suggestions.

"patternPropertyExamples": ["build_task", "test_task", "lint_task", "deploy_task"],
"patternProperties": {
  "(.*)task": {
    ...
  }
}

I created this issue just for a record of my use case. Maybe some other people will find it useful too. It's not something very important, but can definitely be useful for schemas that use patternProperties.

@gregsdennis
Copy link
Member

This sounds like a good candidate for a schema extension keyword, a concept that @handrews, myself, and a few others have been discussing over several issues.

In short, you would be able to define your own keywords, what they mean, and how they interact with the rest of the schema.

Personally, this feels like an application-level feature (live value suggestion as the user types) rather than something that would produce an output during validation or annotation collection.

@fkorotkov
Copy link
Author

Is there an issue to support keywords? Didn't find with a quick search. I'll close this issues and link to the keywords one.

@gregsdennis
Copy link
Member

The primary one would probably be #602 right now. It links to a bunch of other issues that relate to it.

@fkorotkov
Copy link
Author

Thank you, all! Closing this issue. Will watch #602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants