Home » Tag Archives: JSON

Tag Archives: JSON

Query JSON using SQL with Couchbase Query Workbench

couchbase-logo

You’d like to query JSON document database using SQL-like syntax? Couchbase has N1QL for you. N1QL is a declarative query language that extends SQL for JSON. You can query data via native framework and language integration, a fluent API, or the JDBC/ODBC drivers. N1QL enables you to query JSON documents without any limitations – sort, filter, transform, group, and combine ...

Read More »

JWT – Generating and validating a token – Samples

json-logo

JWT provides a very interesting way to represent claims between applications that can be verified and trusted. My objective here is to show a small sample to generate and validate a token using the excellent Nimbus JOSE + JWT library. Overview One of the best places to get an intro is here. In brief, to borrow from the material from ...

Read More »

Scala: working with JSON

json-logo

Working with a JSON is very common task in a software development process. In Scala you can do it in many ways, either with help of Java popular libraries such as Jackson or using Scala specific libraries. How to make a right choice from the Spray JSON, Play JSON, Argonaut, Jackson, Rapture and many more? One day I received a ...

Read More »

JAX-RS and JSON-P integration

json-logo

This short post talks about support for JSON-P in JAX-RS 2.0 JSON-P …? The JSON Processing API (JSON-P) was introduced in Java EE 7. It provides a standard API to work with JSON data and is quite similar to its XML counterpart – JAXP. JSON-B (JSON Binding) API is in the works for Java EE 8. Support for JSON-P in ...

Read More »

Unleash the power of storing JSON in Postgres

json-logo

An article by Sarah Mei titled “Why you should never use MongoDB” discusses the issues you’ll run into if you try to use a NoSQL database when a relational database would be far superior. An example of this is when data that was thought to be in a silo needs to cross boundaries (what relational DBs are great at). Another ...

Read More »

Generating JSON Schema from XSD with JAXB and Jackson

json-logo

In this post, I demonstrate one approach for generating JSON Schema from an XML Schema (XSD). While providing an overview of an approach for creating JSON Schema from XML Schema, this post also demonstrates use of a JAXB implementation (xjc version 2.2.12-b150331.1824 bundled with JDK 9 [build 1.9.0-ea-b68]) and of a JSON/Java binding implementation (Jackson 2.5.4). The steps of this ...

Read More »

How To Return Error Details From REST APIs

json-logo

The HTTP protocol uses status codes to return error information. This facility, while extremely useful, is too limited for many use cases. So how do we return more detailed information? There are basically two approaches we can take:         Use a dedicated media type that contains the error details Include the error details in the used media ...

Read More »

REST API with JSON

json-logo

What is REST API? REST stands for Representational State Transfer. It relies on a stateless, client-server, cacheable communications. In most cases it is used with the HTTP protocol. RESTful applications use HTTP requests to POST (create), PUT (create and/or update), GET (e.g., make queries), and DELETE data. REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.       What ...

Read More »

Converting JSON to XML to Java Objects using XStream

json-logo

XStream library can be an effective tool for converting JSON to Java to XML translations to and fro. Lets explore each one of them one by one, and see which driver is used. Handling JSONs To convert JSON to Java objects all you have to do is initialize XStream object with an appropriate driver and you are ready to serialise ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials