Open AlexKorovyansky opened 10 years ago
I guess the easiest way will be to generate JSON according to yml files and store resulting json on server. I've added initial implementation of all.json that was generated on the base of yml files we have on site. I'm going to finish it by the next week.
No, correct direction generate yaml from json. Converter looks good for me.
YAML is just a data storage representation so there nothing bad in generation JSON from it. This is the basic way of developing API's based on Jekyll. Why do you think that this is not correct direction?
What is really incorrect is to store all data in one JSON file. It's much better to separate all.json to speakers.json, sessions.json, etc. In this case we will have clean and reasonable API for different applications.
1) JSON data from devfest android app has more information, so it's impossible to generate some info from yaml. 2) KISS, it's easy to maintain and update one file.
1) It possible to store anything in yml and to generate a JSON that will suit devfest app. 2) This is exactly what I'm trying to achieve while generating JSON from yml.
Is it so difficult to generate yaml from json?
This is just incorrect way of thinking. This way the web application depends on the data mobile application have. This is absolutely unreasonable.
Weird argument.
I can say the same think about your strange wish the JSON to be the main part of all the applications. Think about YAML as about database and you will understand my point.
Both apps depends on data. There is no dependency between apps. Because current json format is upset of yaml format, I think it's easy to convert superset to subset. Of course, if there is no normal solution for converting json to yaml, and super tool for conversion yaml to json — we can think about conversion subset to superset, by increasing subset (additional step here).
In other words, yaml -> json touches both apps, json -> yaml only one.
yaml -> json does not touch any application at all. json -> yaml make us to absolutely rewrite web application. Don't you understand this?
Why?
Because from yaml we can generate any json we want. But from json we can only get the structure the json had. And after each json update we have to check either the update broke any think in structure or not.
Sample of "Because from yaml we can generate any json we want. But from json we can only get the structure the json had." ?
Yaml has some features that json doesn't have? As I can see for example from team.yaml it's possible to generate it from current json.
We can do this but why? Why do you want to break web application and make me to do more work than I can do?
I'm not competing with anybody on commit making. So what is the reasonable reason in this?
Why json->yaml break it? :-) Maybe I don't see some problem?
You want me to regenerate yml files from json. We have json that has different structure so yml files will have different structure too. To make webapp work we will need to rewrite it to suit new data structure. If you want just to move data from json to yml we don't need to regenerate anything we just need to move data and than always update yml files. In this case JSON will be always up-to-date.
Of course, I don't mean change structure, it should be task of converter to convert saving structure, but with moving data.
Exactly, I find "JSON will be always up-to-date" is good profit. But maybe I'm skipping something important.
As discussed in Kantanello, we will use yaml as origin format, and hook jekyl to generate json views compatibles with android app.
Format of json files is described here — https://github.com/google/iosched/blob/master/doc/SYNC.md
At this moment devfest-site and devfest-app have their own and incompatible data formats to present information about conference. Devfest-site uses yaml, while devfest-app uses json.
Goal is to use the same format for both, without changes of devfest-app, so it should be format of devfest-app (maybe extended with backward compatibility).
Yaml files are being used in devfest-site:
Json files used in devfest-app: