// Path: dsl-json-lagom/src/main/java/org/revenj/json/lagom/DslJsonLagomSerialization.java
// public class DslJsonLagomSerialization {
//     public static <T extends com.lightbend.lagom.javadsl.api.Service> PMap<Type, MessageSerializer<?,?>> optimizeSerializersFor(final Class<T> service) {
//         PMap<Type, MessageSerializer<?,?>> result = HashTreePMap.empty();
//         final DslJsonSerialization serialization = new DslJsonSerialization(null, Optional.empty());
// 
//         final Method[] serviceMethods = service.getMethods();
//         for (final Method serviceMethod : serviceMethods) {
//             if (serviceMethod.getReturnType() != ServiceCall.class) continue;
//             final ParameterizedType genericReturnType = (ParameterizedType) serviceMethod.getGenericReturnType();
//             final Type[] arguments = genericReturnType.getActualTypeArguments();
// 
//             for (int i = 1; i <= 2; i ++) {
//                 final Type type = arguments[i];
//                 if (type == NotUsed.class) continue;
// 
//                 if (result.containsKey(type)) continue;
//                 result = result.plus(type, new DslJsonMessageSerializer<>(type, serialization));
//             }
//         }
//         return result;
//     }
// }


import static com.lightbend.lagom.javadsl.api.Service.named;
import static com.lightbend.lagom.javadsl.api.Service.restCall;
import java.util.List;
import org.revenj.json.lagom.DslJsonLagomSerialization;
import com.lightbend.lagom.javadsl.api.Descriptor;
import com.lightbend.lagom.javadsl.api.Service;
import com.lightbend.lagom.javadsl.api.ServiceCall;
import com.lightbend.lagom.javadsl.api.transport.Method;
import akka.NotUsed;
import worldwonders.wonders.NewComment;
import worldwonders.wonders.Wonder;
package worldwonders.wonders.api;






public interface WondersService extends Service {
    ServiceCall<NotUsed, NotUsed, List<Wonder>> findAll();

    ServiceCall<NotUsed, NotUsed, List<String>> getWonderTypes();

    ServiceCall<NotUsed, Wonder, NotUsed> makeWonder();

    ServiceCall<NotUsed, NewComment, NotUsed> newComment();

    @Override
    default Descriptor descriptor() {
        return named("wonders-service").with(
                restCall(Method.GET, "/wonders", findAll()),
                restCall(Method.GET, "/wonderTypes", getWonderTypes()),
                restCall(Method.POST, "/wonder", makeWonder()),
// Path: dsl-json-lagom/src/main/java/org/revenj/json/lagom/DslJsonLagomSerialization.java
// public class DslJsonLagomSerialization {
//     public static <T extends com.lightbend.lagom.javadsl.api.Service> PMap<Type, MessageSerializer<?,?>> optimizeSerializersFor(final Class<T> service) {
//         PMap<Type, MessageSerializer<?,?>> result = HashTreePMap.empty();
//         final DslJsonSerialization serialization = new DslJsonSerialization(null, Optional.empty());
// 
//         final Method[] serviceMethods = service.getMethods();
//         for (final Method serviceMethod : serviceMethods) {
//             if (serviceMethod.getReturnType() != ServiceCall.class) continue;
//             final ParameterizedType genericReturnType = (ParameterizedType) serviceMethod.getGenericReturnType();
//             final Type[] arguments = genericReturnType.getActualTypeArguments();
// 
//             for (int i = 1; i <= 2; i ++) {
//                 final Type type = arguments[i];
//                 if (type == NotUsed.class) continue;
// 
//                 if (result.containsKey(type)) continue;
//                 result = result.plus(type, new DslJsonMessageSerializer<>(type, serialization));
//             }
//         }
//         return result;
//     }
// }


// Path: wonders-api/src/main/java/worldwonders/wonders/api/WondersService.java
import static com.lightbend.lagom.javadsl.api.Service.named;
import static com.lightbend.lagom.javadsl.api.Service.restCall;
import java.util.List;
import org.revenj.json.lagom.DslJsonLagomSerialization;
import com.lightbend.lagom.javadsl.api.Descriptor;
import com.lightbend.lagom.javadsl.api.Service;
import com.lightbend.lagom.javadsl.api.ServiceCall;
import com.lightbend.lagom.javadsl.api.transport.Method;
import akka.NotUsed;
import worldwonders.wonders.NewComment;
import worldwonders.wonders.Wonder;

package worldwonders.wonders.api;






public interface WondersService extends Service {
    ServiceCall<NotUsed, NotUsed, List<Wonder>> findAll();

    ServiceCall<NotUsed, NotUsed, List<String>> getWonderTypes();

    ServiceCall<NotUsed, Wonder, NotUsed> makeWonder();

    ServiceCall<NotUsed, NewComment, NotUsed> newComment();

    @Override
    default Descriptor descriptor() {
        return named("wonders-service").with(
                restCall(Method.GET, "/wonders", findAll()),
                restCall(Method.GET, "/wonderTypes", getWonderTypes()),
                restCall(Method.POST, "/wonder", makeWonder()),
                restCall(Method.POST, "/new-comment", newComment())