Tags » JSON

Reduce the json size in MVC 6

In here we removed all default value and null in our json output.

services.AddMvc()
        .Configure<MvcOptions>(options => {
          var jsonOutputFormatter = new JsonOutputFormatter();
          jsonOutputFormatter.SerializerSettings.DefaultValueHandling = DefaultValueHandling.Ignore;
          jsonOutputFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;

          options.OutputFormatters.RemoveTypesOf<JsonOutputFormatter>();
          options.OutputFormatters.Insert(0, jsonOutputFormatter);
          });
.Net

MongoDB in Java: Search for a value in a nested entry

Given the MongoDB entry below, how do we search for “occupation: doctor”?

{
"name" : Maren,
"age" : 29,
"details" : {
 address : "Geronimo Road"
 occupation: "doctor"
 }
}

{
"name" : Skoo,
"age" : 35, 
"details" : {
 address : "West Village, Hudensta"
 occupation: "warrior"
 }
}

{
"name" : Doby,
"age : 31,
"details" : {
 address : "99 Jump Street"
 occupation: "doctor"
 }
}
… 108 more words
Java

Grails' JSONObject.NULL More or Less Equal To Null

Since Groovy 1.8 we can check if a Map is equal to another Map if the keys and values are the same. Very convenient in tests for example. 384 more words

Grails

Legendary Star-Lord #12

Legendary Star-Lord #12

Written by: Sam Humpries

Art by: Paco Medina

Cover by: Paco Medina

Released: May 13, 2015

Before SECRET WARS puts most of the Marvel Universe on hold, the half-sister of Peter Quill, is on a quest to get the body of her father, J-Son, back from the collecting clutches of The Collector. 304 more words

Marvel

Send an image using Asp.net MVC 5 API and consume it in a Universal app

We here need to get an array of byte image from Sql Server 2014 via a stored procedure, send it through the Asp.net MVC 5 API and consume it in a Universal app for both Windows store and Windows mobile consuming of it. 93 more words

Blocstagram

It’s been a while since I last checked in, but I’ve been steadily working on creating an Instagram clone. Biggest things I’ve been learning:

1) Going from using storyboard to using code to make objects on screen. 535 more words

OpenJPA and Date JSON serialization

Following the trends, you can try to push your entities to the front layer of your application without any in between conversion. A common sample is to return an entity in a JAX-RS bean. 328 more words

JavaEE