Code Monkey home page Code Monkey logo

denner-portal-api-spec's Introduction

Denner Portal 2.0 API Spec

Terms and translations

Consider the following terms:

DE EN
Filiale Store
Artikel Article
Werbemittel Publication
Aktion Promotion
bewerben advertise

Data and resources

The Denner Portal provides mostly advertising related data.

Stores

  • /stores (Filialen, example)
  • /store-channels (Filialkanäle, example)
  • /store-services (Filialangebote, example)
  • /screen-stores (Screen-Filialen, example)

Articles/Promotions

  • /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)

Advertising

Online

  • /online-publications (Online-Werbemittel, example)
  • /online-publication-articles/{article_id} (Online-Werbemittel-Artikel, example)
  • /online-filters (Angebotsfilter, example)

Screen

  • /screen-publications (Screen-Werbemittel, example)

Print

  • /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

  • /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)

Building

Protobox

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

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

HTML

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.

denner-portal-api-spec's People

Contributors

christian-schmid-ch avatar curzio-della-santa avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.