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

naming conventions for collections #7

Open
yogthos opened this issue Jun 19, 2017 · 8 comments
Open

naming conventions for collections #7

yogthos opened this issue Jun 19, 2017 · 8 comments

Comments

@yogthos
Copy link

yogthos commented Jun 19, 2017

Problem

Idiomatic JSON naming convention is to use plural names for collections, e.g:

{
   "name": [...]
}

Solution

We propose using plural names to hint that the value is a collection type:

{
   "names": [...]
}

This convention provides a hint to the user to indicate that the value referenced by the key is a collection, and makes it easier to navigate the JSON structure.

@vadi2
Copy link

vadi2 commented Jun 28, 2017

How do you propose it is displayed in the resource viewer however where it'll be name [0..*]?

@yogthos
Copy link
Author

yogthos commented Jun 29, 2017

That's an interesting point, this would add inconvenience in mapping resource definitions to JSON.

@grahamegrieve
Copy link

grahamegrieve commented Jun 29, 2017 via email

@yogthos
Copy link
Author

yogthos commented Jun 29, 2017

fair enough

@vadi2
Copy link

vadi2 commented Jun 29, 2017

Asking a possibly stupid question, why not call it names in the FHIR resource model if has max >1 multiplicity?

@grahamegrieve
Copy link

grahamegrieve commented Jun 29, 2017 via email

@vadi2
Copy link

vadi2 commented Jun 29, 2017

Yep, fair enough. XML is still kicking around so it's a topic to revisit in a decade...

@grahamegrieve
Copy link

grahamegrieve commented Jun 29, 2017 via email

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