Quick and dirty fix to sulfur build problems in CI
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / gnpy / consumer / GnpyApiModule.java
1 /*
2  * Copyright © 2021 Orange, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.transportpce.pce.gnpy.consumer;
9
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;
15
16
17
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 {
21
22     private static final long serialVersionUID = 1L;
23
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));
28     }
29 }