JonathanGiles / TeenyHttpd

TeenyHttpd is a HTTP server written in Java.
MIT License
17 stars 3 forks source link

Teeny json suport #3

Closed alex-cova closed 3 months ago

alex-cova commented 9 months ago

Removed @Transient and java.desktop requirement, and created @JsonIgnore as replacement.

Usage:

String json = new TeenyJson().writeValueAsString(person);
alex-cova commented 8 months ago

TeenyJson now can parse more complex JSONs like:

{
  "name": "Alex",
  "age": 25,
  "objectB": {
    "name": "Jonathan",
    "age": 30,
    "objectC": {
      "name": "John Doe",
      "age": 23
    }
  },
  "developer": true
}
ObjectA objectA = new TeenyJson()
                .readValue(json, ObjectA.class);

ObjectA.class

Also collections

List<ProductDto> products = new TeenyJson()
                .readList(json, ProductDto.class);

I should change readList to readCollection(json, List.class, ProductDto.class) to match the user collection.

JonathanGiles commented 8 months ago

Do you want this merged now, or do you want to keep working on it? We also need to update the readme.

alex-cova commented 8 months ago

Do you want this merged now, or do you want to keep working on it? We also need to update the readme.

uff I didn't realize that there are a lot of cases, there is a few cases missing especially with collections an Maps, I believe to have a decent version this week

JonathanGiles commented 7 months ago

Let me know when you want another review!

alex-cova commented 7 months ago

Let me know when you want another review!

Sorry for the late response, I've been sick these days. Yes please, another review would be awesome, I consider this PR can now be merged

JonathanGiles commented 6 months ago

I'm back! I've been travelling and busy with work / life. I'll get to reviewing this today.

alex-cova commented 6 months ago

I'm back! I've been travelling and busy with work / life. I'll get to reviewing this today.

Welcome back!, no problem I was also quite busy :P looking forward for new challenges

JonathanGiles commented 3 months ago

Only very minor feedback - then we can merge. Thanks