cia_world_factbook_api
cia_world_factbook_api copied to clipboard
Formalise schema
When the parser becomes a bit more mature it would be good to have a formal schema available
Something like http://json-schema.org/
I have a feeling there's still some bits and pieces that are inconsistent
eg I think percentage values are represented in two different ways
{"percent": 1.5}
vs
{"value": 1.5, "units": "%"}
Some additional useful links from datasets/registry issue 201 referenced above
i'm thinking about packaging (some of the data) as tabular data packages:
http://frictionlessdata.io/data-packages/ http://frictionlessdata.io/guides/tabular-data-package/
https://specs.frictionlessdata.io/tabular-data-resource/
Especially adding a Table Schema https://specs.frictionlessdata.io/table-schema/
@iancoleman note that Table Schema has a pattern for adding units: https://github.com/frictionlessdata/specs/issues/216.
The JSON names are not in Pascal Case. If they were converted to PascalCase they would directly translate into classes better.
Currently I get an automatic JSON conversion to a C# class that looks as follows. As you can see this is less than optimal from the var/method naming deserialization perspective.
public class Electricity
{
public Access access { get; set; }
public Production production { get; set; }
public Consumption consumption { get; set; }
public Exports exports { get; set; }
public Imports imports { get; set; }
public InstalledGeneratingCapacity installed_generating_capacity { get; set; }
public BySource by_source { get; set; }
}
Is it possible for the names to be in pascal case? This would make importing it more consistent and deserializing it directly to objects cleaner.
I did some looking at conventions and the best I came up with (google JSON style guide) recommends camelCase.
Would camelCase be ok or would you specifically prefer PascalCase?