Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

YaaS.clj: A Clojure Client Library for Hybris-as-a-Service

DZone's Guide to

YaaS.clj: A Clojure Client Library for Hybris-as-a-Service

YaaS.clj is an open Clojure library that aims to simplify access to the SAP Hybris as a Service (YaaS) REST APIs, particularly useful when using microservices.

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

Recently, I decided to start a Clojure client library project for SAP Hybris as a Service (YaaS). But before the client library, let's see what YaaS is according to yaas.io and hybris.com

What Is SAP Hybris-as-a-Service (YaaS)?

YaaS is a microservices ecosystem helping businesses to rapidly augment and build new, highly flexible solutions.










With YaaS, you have the power to quickly develop custom applications that blend trusted SAP Hybris solutions with your company’s existing platforms.

YaaS microservices give you the flexibility to launch cutting-edge apps that engage your customers on any device without sacrificing security and without breaking your budget.

Back to YaaS.clj

YaaS already has a Node.js client library, which is published by Hybris Labs, called YaaS.js. It covers some of the SAP Hybris as a Service (YaaS) REST APIs.

I started looking into YaaS.js and the YaaS API documentation, which is found here, then I started to write a client library with Clojure for YaaS.

And here what we have so far:

(require '[yaas-clojure-client-sdk :as yaas])

(yaas/init! {:client-id "<CLIENT_ID>"
             :client-secret "<CLIENT_SECRET>"
             :scope "<SCOPE>"
             :project-id "<PROJECT_ID>"})


You need a YaaS account and a configured YaaS project and application for the required OAuth2 credentials. Also, you might want to add some products for testing.

Then, let’s get a list of products:

(require '[yaas-clojure-client-sdk.product :as product])

(product/get-products :fields [:code :name :description]
                      :sort {:name.en :asc})


It’s in the very early stages of development and, of course, it’s not ready for production but you can still use it. Contributions and pull requests are always welcome!

You can reach the repository on GitHub.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:
sap hybris commerce ,clojure ,java ,library ,microservices

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}