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

Question: Support for NSSet in the JSON schema? #70

Closed
oferRounds opened this issue Jul 31, 2017 · 2 comments
Closed

Question: Support for NSSet in the JSON schema? #70

oferRounds opened this issue Jul 31, 2017 · 2 comments

Comments

@oferRounds
Copy link

Hi!

Just starting to use Plank, looks awesome!

Small question: just wondering, what is the reason that NSSet is not included as one of the Schema’s Property Types?

@rahul-malik
Copy link
Collaborator

@oferRounds - The reason mostly is that there is no JSON notation for expressing sets so currently we support arrays and dictionaries (maps) as our collections. That said, there is a property in the JSON Schema specification (unique) that we could use to generate sets.

I would expect a set to be declared like so:

some_prop: {
  type: "array",
  unique: true
}

We could infer based on this schema description that the correct type would be a set. Thoughts?

@oferRounds
Copy link
Author

Hi @rahul-malik, thanks for your comment! I like the idea, can’t think of any better option. Just want to add that the key is uniqueItems.

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

2 participants