2 * Copyright © 2021 Orange, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.transportpce.pce.gnpy.consumer;
10 import com.fasterxml.jackson.databind.module.SimpleModule;
11 import com.fasterxml.jackson.datatype.jsr310.PackageVersion;
12 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
13 import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev220221.Request;
14 import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.Result;
18 //This class is a temporary workaround while waiting jackson
19 //support in yang tools https://git.opendaylight.org/gerrit/c/yangtools/+/94852
20 public class GnpyApiModule extends SimpleModule {
22 private static final long serialVersionUID = 1L;
24 public GnpyApiModule(JsonStringConverter<Request> requestConverter, JsonStringConverter<Result> resultConverter) {
25 super(PackageVersion.VERSION);
26 addSerializer(Request.class, new RequestSerializer(requestConverter));
27 addDeserializer(Result.class, new ResultDeserializer(resultConverter));