Giter Site home page Giter Site logo

ocpi-endpoints's Introduction

OCPI endpoints Build Status

The New Motion implementation of common endpoints of the OCPI protocol.

See http://github.com/ocpi/ocpi

Notions

To make clear when the parameters are about the application making use of the application or the party the application is connecting to they are referred as: our/us or theirs/them

Dependencies

To find out if there is any dependency to be updated you can run sbt dependencyUpdates to see what could be updated. See https://github.com/rtimush/sbt-updates

Usage

See the example app in the example folder. You can run it with sbt by typing project example followed by run. Once running you can make version requests with

curl -X GET -H "Authorization: Token abc" "http://localhost:8080/example/versions"

Serialization support

You can use either Circe (recommended) or Spray-Json for (de)serialization of JSON

Circe

In build.sbt

libraryDependencies += "com.thenewmotion.ocpi" %% s"ocpi-msgs-circe" % "0.7.6"

Then in the route or client you want to use

import com.thenewmotion.ocpi.msgs.circe.v2_1.protocol._

Spray Json

In build.sbt

libraryDependencies += "com.thenewmotion.ocpi" %% s"ocpi-msgs-spray-json" % "0.7.6"

Then in the route or client you want to use

import com.thenewmotion.ocpi.msgs.sprayjson.v2_1.protocol._

Changelog

0.7.10

  • Pass the requester's globalPartyId to MspTokenService methods
  • Stop passing the ExecutionContext from Routes into Services in some cases

0.7.9

  • Require non empty ids
  • Improved Generic merging or patches using Shapeless
  • Validation for Latitude and Longitude

0.7.8

  • Tokens Client for CPO Tokens module
  • Don't include akka-http-spray-json anymore, as spray json is optional

0.7.7

  • Many of the modules have a method such as createOrUpdate*, this method used to take both an id from the url and an object.Now, they only take an object, and the validation that the id of the url and and the id from the object are validated by the library
  • Remove the id fields from the Patch object, as the id cannot be changed

0.7.6

  • Added Sessions module
  • When using a route or a client, you will need to import the Circe or Spray Json modules, as above
  • You no longer need to use new to create a route, each one has a companion object, and then the route can be used directly instead of having to use the .route method. See the ExampleApp.
  • Many of the services previously had methods returning Future[Either[SessionError, Boolean]] where a Right(true) meant the record has been updated and a Right(false) meant it was updated. This has been replaced by Right(Created) and Right(Updated)

ocpi-endpoints's People

Contributors

cristinarc avatar kiequoo avatar poohsen avatar dstranger avatar samansattari avatar

Watchers

 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.