Home » JSON

Tag Archives: JSON

Escape JSON property names in jq

I’m using the command line a lot and jq is a helpful tool for dealing with JSON data. You can access JSON object properties and array elements by concatenating the property names with dots and square brackets: 1 gt; cat ~/.docker/config.json { "auths": { "https://index.docker.io/v1/": { "auth": "aBcDeFghiJKlMn=" }, [...] } } 1 gt; cat .docker/config.json | jq . { ...

Read More »

In praise of the thoughful design: how property-based testing helps me to be a better developer

The developer’s testing toolbox is one of these things which rarely stays unchanged. For sure, some testing practices have proven to be more valuable than others but still, we are constantly looking for better, faster and more expressive ways to test our code. Property-based testing, largely unknown to Java community, is yet another gem crafted by Haskell folks and described ...

Read More »

Hash a Json

I recently wrote a simple library to predictably hash a json. The utility is built on top of the excellent Jackson Json parsing library Problem I needed a hash generated out of a fairly large json based content to later determine if the content has changed at all. Treating json as a string is not an option as formatting, shuffling ...

Read More »

Spring MVC – HTTP message converter

Quite often you need to provide users with the same data, but in different forms, like JSON, PDF, XLS, etc. If your application is Spring Framework based, this task can be achieved using HTTP message converters. HTTP message converters are applied when HTTP request (or its parts) needs to be converted into type required for handler method argument (see: Handler ...

Read More »

JSON and XML: How Do They Compare?

java-interview-questions-answers

JSON and XML: How Do They Compare? JSON and XML are two human-readable text formats that have emerged as rivals over the years. XML’s purpose is storing and defining documents and data through the optional use of a schema. JSON was almost the exact opposite – a serialization format with requirements so simple they fit on the back of a ...

Read More »

Consuming JSON based REST Web Service in ADF 12.2.1.3

Previously I have posted about consuming ADF BC based REST Web Service in ADF. Now, this post talks about consuming JSON based REST Web Service using generic data control. You can also look at previous posts on Web Service for more information. Create SOAP Web Service with Application Module quickly in ADF 12.2.1 Create REST Web Service with Application Module ...

Read More »

Tutorial: Create and Verify JWTs in Java

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Java support for JWT (JSON Web Tokens) used to require a lot of work: extensive customization, hours lost resolving dependencies, and pages of code just to assemble ...

Read More »

Simple Token Authentication for Java Apps

“I love writing authentication and authorization code.” ~ No Web Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. JSON Web Tokens have quickly become the standard for securing web applications, superseding older technologies like cookies and sessions. Used properly, they address a range of security ...

Read More »

Java: Streaming a JDBC ResultSet as JSON

This post shows how you can convert a java.sql.ResultSet to JSON and stream it back to the caller. This is useful if you want to send a large dataset from a JDBC DataSource to a web application in JSON format. Streaming allows you to transfer the data, little by little, without having to load it all into the server’s memory. ...

Read More »