-
Notifications
You must be signed in to change notification settings - Fork 46
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
Create method to get available property names from API #44
Comments
@sthiepaan I agree, all countries should have these properties to maintain consistency, irrespective of whether data is present for them or not. I think maintaining separate schema for the properties is a good idea. |
JSON Schema is definitely a a thing to consider. We could use Ajv for that. Should we care about the usability of some properties? Or just list them all and let user decide if they want to extract some from that list? |
Hmm, JSON schema is great, but at the same time we have to look at the bundle size of the library |
You are right @bhatvikrant. Less dependencies ➡️ smaller bundle ➡️ the better! If API gets too complicated we might consider using external tools to handle data models easily. But for now, since we do not have multiple abstractions, different datas etc. we could write a test with Jasmine to handle this. Shouldn't be that hard tho 🤔 |
As mentioned in #32 we could extend this package with:
After calling that method what we could receive is:
Unfortunately, not all of those properties are "useful" for that.
My first idea was to simply grab first item from
data
and extract its all property names. But I am not 100% sure if this is a clean and proper way to do. Maybe instead we should just define it separately and keep in mind to maintain together with changes to the data model 🤔Feel free to have an input how can we achieve this!
The text was updated successfully, but these errors were encountered: