scholix / schema

The Scholix metadata schema is a set of properties describing a Link Information Package, which carries information about a link between two scholarly communication objects.
GNU General Public License v3.0
14 stars 2 forks source link

RFC agree on a casing for the JSON schema #6

Open krzysztof opened 6 years ago

krzysztof commented 6 years ago

It looks right now that the JSON schema uses a mix of lowerCamelCase/UpperCamelCase styles for the JSON schemas: https://github.com/scholix/schema/blob/master/json/v3/schema.json I guess this comes as a direct translation from XML's ElementNames and propertyNames, which are Upper/lower case respectively. To the best of my knowledge, this is not a very popular choice for JSON Schemas and REST APIs, and perhaps JSON schema should not follow the XML that close when it comes to property name style convention? The variable names, when named carefully, can be mapped from one casing to another deterministicly, so the documentation should not be a problem.

See discussion on JSON naming at: https://stackoverflow.com/questions/5543490/json-naming-convention. Two most common styles are:

krzysztof commented 6 years ago

One inconsistency with the naming, lowercase identifier here: https://github.com/scholix/schema/blob/master/json/v3/schema.json#L35

vs Identifier here and in many other places: https://github.com/scholix/schema/blob/master/json/v3/schema.json#L145

Was this in any way intentional? Can this be unified?

krzysztof commented 6 years ago

It looks like they only non UpperCamelCase properties are:

"LinkProvider/name" https://github.com/scholix/schema/blob/master/json/v3/schema.json#L323 and "LinkProvider/identifier": https://github.com/scholix/schema/blob/master/json/v3/schema.json#L35

I guess the easiest would be to just upcase those two.

krzysztof commented 6 years ago

This PR should contain a schema with a UpperCase consistent names: https://github.com/scholix/schema/pull/7