Написать програму которая обработает JSON запрос (практика)

package org.example;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.util.Arrays;

/**
 * Hello world!
 *
 */
public class App{
    static final String JSON_STRING = """
                    {
                      books: [
                              {
                                  "name": "Book1",
                                  "price": 55.99
                              },
                              {
                                  "name": "Book2",
                                  "price": 10
                              }
                          ],
                          "shop": "Shop name"
                          
                    }
            """;
    static class Books{
            String name;
            String price;

        @Override
        public String toString() {
            return "Books{" +
                    "name='" + name + '\'' +
                    ", price='" + price + '\'' +
                    '}';
        }
    }
    static class Shop{
        String shop;
        Books[] books;

        @Override
        public String toString() {
            return "Shop{" +
                    "shop='" + shop + '\'' +
                    ", books=" + Arrays.toString(books) +
                    '}';
        }
    }
    public static void main( String[] args ) {
        Gson gson= new GsonBuilder().setPrettyPrinting().create();
        Shop shop = gson.fromJson(JSON_STRING, Shop.class);
        System.out.println(shop);

        String json = gson.toJson(shop);
        System.out.println(json);
    }
}

Предложенное вами решение верно