gdgomsk / devfest-site

Web Site for GDG DevFest Omsk 2014
http://devfest.gdgomsk.org/
MIT License
2 stars 0 forks source link

YAML -> JSON data converter #13

Open AlexKorovyansky opened 10 years ago

AlexKorovyansky commented 10 years ago

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:

jastkand commented 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.

AlexKorovyansky commented 10 years ago

No, correct direction generate yaml from json. Converter looks good for me.

jastkand commented 10 years ago

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?

jastkand commented 10 years ago

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.

AlexKorovyansky commented 10 years ago

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.

jastkand commented 10 years ago

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.

AlexKorovyansky commented 10 years ago

Is it so difficult to generate yaml from json?

jastkand commented 10 years ago

This is just incorrect way of thinking. This way the web application depends on the data mobile application have. This is absolutely unreasonable.

AlexKorovyansky commented 10 years ago

Weird argument.

jastkand commented 10 years ago

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.

AlexKorovyansky commented 10 years ago

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).

AlexKorovyansky commented 10 years ago

In other words, yaml -> json touches both apps, json -> yaml only one.

jastkand commented 10 years ago

yaml -> json does not touch any application at all. json -> yaml make us to absolutely rewrite web application. Don't you understand this?

AlexKorovyansky commented 10 years ago

Why?

jastkand commented 10 years ago

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.

AlexKorovyansky commented 10 years ago

Sample of "Because from yaml we can generate any json we want. But from json we can only get the structure the json had." ?

AlexKorovyansky commented 10 years ago

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.

jastkand commented 10 years ago

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?

jastkand commented 10 years ago

I'm not competing with anybody on commit making. So what is the reasonable reason in this?

AlexKorovyansky commented 10 years ago

Why json->yaml break it? :-) Maybe I don't see some problem?

jastkand commented 10 years ago

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.

AlexKorovyansky commented 10 years ago

Of course, I don't mean change structure, it should be task of converter to convert saving structure, but with moving data.

AlexKorovyansky commented 10 years ago

Exactly, I find "JSON will be always up-to-date" is good profit. But maybe I'm skipping something important.

AlexKorovyansky commented 10 years ago

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