//in case of implicit RPC input (StatementSource.CONTEXT),
// stay compatible (no input argument generated)
if (input != null && isExplicitStatement(input)) {
+ processUsesAugments(input, module);
final GeneratedTypeBuilder inType = addRawInterfaceDefinition(basePackageName, input, rpcName);
addImplementedInterfaceFromUses(input, inType);
inType.addImplementsType(DATA_OBJECT);
//in case of implicit RPC output (StatementSource.CONTEXT),
//stay compatible (Future<RpcResult<Void>> return type generated)
if (output != null && isExplicitStatement(output)) {
+ processUsesAugments(output, module);
final GeneratedTypeBuilder outType = addRawInterfaceDefinition(basePackageName, output, rpcName);
addImplementedInterfaceFromUses(output, outType);
outType.addImplementsType(DATA_OBJECT);
--- /dev/null
+/*
+ * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.mdsal.binding.generator.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.FileNotFoundException;
+import java.net.URISyntaxException;
+import java.util.List;
+import org.junit.Test;
+import org.opendaylight.mdsal.binding.model.api.Type;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
+
+public class Mdsal302Test {
+
+ @Test
+ public void bug4145Test() throws FileNotFoundException, ReactorException, URISyntaxException {
+ SchemaContext context = YangParserTestUtils.parseYangSource("/mdsal-302/mdsal-302.yang");
+
+ List<Type> generateTypes = new BindingGeneratorImpl(false).generateTypes(context);
+ assertNotNull(generateTypes);
+ assertEquals(15, generateTypes.size());
+ }
+}