final SchemaInferenceStack stack, final OAversion oaversion)
throws IOException {
for (final ActionDefinition actionDef : ((ActionNodeContainer) childNode).getActions()) {
+ stack.enterSchemaTree(actionDef.getQName());
processOperations(actionDef, moduleName, definitions, definitionNames, stack, oaversion);
+ stack.exit();
}
}
Assert.assertNotNull(jsonObject);
}
+ @Test
+ public void testActionTypes() throws Exception {
+ final Optional<? extends Module> module = context.findModule("action-types");
+ assertTrue("Desired module not found", module.isPresent());
+ final DefinitionGenerator generator = new DefinitionGenerator();
+ final ObjectNode jsonObject = generator.convertToJsonSchema(module.get(), context,
+ new DefinitionNames(), ApiDocServiceImpl.OAversion.V2_0, true);
+ Assert.assertNotNull(jsonObject);
+ }
+
@Test
public void testStringTypes() throws Exception {
final Optional<? extends Module> module = context.findModule("string-types");
--- /dev/null
+module action-types {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:test:action:types";
+ prefix "act-tp";
+
+ list list {
+ key name;
+ leaf name {
+ type string;
+ }
+ action list-action {
+ input {
+ leaf la-input {
+ type string;
+ mandatory true;
+ }
+ }
+ output {
+ leaf la-output {
+ type string;
+ mandatory true;
+ }
+ }
+ }
+ }
+
+ container container {
+ action container-action {
+ input {
+ leaf ca-input {
+ type string;
+ mandatory true;
+ }
+ }
+ output {
+ leaf ca-output {
+ type string;
+ mandatory true;
+ }
+ }
+ }
+ }
+
+ container multi-container {
+ container inner-container {
+ action action {
+ }
+ }
+ }
+}