Consider the following terms:
DE | EN |
---|---|
Filiale | Store |
Artikel | Article |
Werbemittel | Publication |
Aktion | Promotion |
bewerben | advertise |
The Denner Portal provides mostly advertising related data.
/stores
(Filialen, example)/store-channels
(Filialkanäle, example)/store-services
(Filialangebote, example)/screen-stores
(Screen-Filialen, example)
/article-groups
(Warengruppen, example)/articles
(Artikel, example)/shop-wines
(Wineshop-Weine)/mobile-wines
(Mobile-App-Weine)/online-groups
(Internet-Sortimente, example)/online-specials
(Online-Specials, example)/advertised-articles
(beworbene Artikel)/promotion-types
(Aktionstypen, example)
/online-publications
(Online-Werbemittel, example)/online-publication-articles/{article_id}
(Online-Werbemittel-Artikel, example)/online-filters
(Angebotsfilter, example)
/screen-publications
(Screen-Werbemittel, example)
/print-publications
(Print-Werbemittel, example)/print-publications/{publication_id]
(Print-Werbemittel, example)/print-layouts
(Print-Layoutarten, example)/print-formats
(Print-Formate und -Vorlagen, example)/print-schemes
(Print-Werbemittelschemas, example)
/appraisals
(Weinbeurteilungen, example)/appraisals/{appraisal_id}
(Weinbeurteilung, example)/appraisal-statistic/{date}
(Statistiken zu Weinbewertungen und -beurteilungen, example)/ratings
(Weinbewertungen, example)/ratings/{article_id}
(Weinbewertung, example)/sweepstake-participants
(Verlosungsteilnehmer, example)
To build the specification we're using swagger-codegen.
Run the following commands in Protobox to install it (and it's dependencies):
sudo apt-get update
sudo apt-get install maven
sudo apt-get install openjdk-7-jdk
git clone [email protected]:swagger-api/swagger-codegen.git
cd swagger-codegen
mvn package
If Maven reports loo low version on packaging, follow those instructions to upgrade to latest version.
You should also install the JSON processor utility for further data manipulation:
sudo apt-get install npm
sudo npm install -g json
Once installed, swagger.json
can be generated as follows:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i ../denner-portal-api-spec/src/swagger.yml \
-l swagger \
-o ../denner-portal-api-spec/build/swagger
The file will be located at build/swagger/swagger.json
.
To filter out examples and descriptions execute following (JSON processor needed):
json -e '
function dropRecursive(obj, objName) {
if (objName != "properties") {
delete obj.examples;
delete obj.example;
delete obj.description;
delete obj.summary;
}
for (var key in obj) {
if (obj[key] && typeof obj[key] === "object") {
dropRecursive(obj[key], key);
}
}
}
dropRecursive(this, 'this');
' < ../denner-portal-api-spec/build/swagger/swagger.json > ../denner-portal-api-spec/build/swagger/swagger.no_texts.json
The file will be located at build/swagger/swagger.no_texts.json
.
To compress all your JSON data execute following (JSON processor needed):
for f in `ls ../denner-portal-api-spec/build/swagger/*.json | grep -v "compressed"`
do
json -o json-0 < $f > "${f%.json}.compressed.json"
done
You can also generate a static HTML page:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i ../denner-portal-api-spec/src/swagger.yml \
-l html \
-o ../denner-portal-api-spec/build/html
The file will be located at build/html/index.html
.