From 3830698b5b7c415a06f40ea68061f82c5a8052e0 Mon Sep 17 00:00:00 2001 From: lubos-cicut Date: Thu, 29 Feb 2024 22:31:49 +0100 Subject: [PATCH] OpenAPI: Add test for inner action schema Add test case to verify that schema for action which is nested inside multiple containers is correctly referenced. JIRA: NETCONF-1259 Change-Id: I98266506f24354cf3a3fb764bfee8d7ee6c74393 Signed-off-by: lubos-cicut --- .../controller-action-types.json | 571 ++++++++++++++++++ .../yang-document/controller-all.json | 571 ++++++++++++++++++ .../yang-document/device-action-types.json | 571 ++++++++++++++++++ .../resources/yang-document/device-all.json | 571 ++++++++++++++++++ .../src/test/resources/yang/action-types.yang | 19 + 5 files changed, 2303 insertions(+) diff --git a/restconf/restconf-openapi/src/test/resources/yang-document/controller-action-types.json b/restconf/restconf-openapi/src/test/resources/yang-document/controller-action-types.json index cc34adf04a..1457c109f4 100644 --- a/restconf/restconf-openapi/src/test/resources/yang-document/controller-action-types.json +++ b/restconf/restconf-openapi/src/test/resources/yang-document/controller-action-types.json @@ -791,6 +791,512 @@ "description": "", "summary": "POST - Controller - action-types - action" } + }, + "/rests/data/action-types:first-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - Controller - action-types - first-container", + "tags": [ + "Controller action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - Controller - action-types - first-container", + "tags": [ + "Controller action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - Controller - first-container", + "tags": [ + "Controller action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - Controller - action-types - first-container", + "tags": [ + "Controller action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - Controller - first-container", + "tags": [ + "Controller action-types" + ] + } + }, + "/rests/data/action-types:first-container/second-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - Controller - action-types - second-container", + "tags": [ + "Controller action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - Controller - action-types - second-container", + "tags": [ + "Controller action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - Controller - second-container", + "tags": [ + "Controller action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - Controller - action-types - second-container", + "tags": [ + "Controller action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - Controller - second-container", + "tags": [ + "Controller action-types" + ] + } + }, + "/rests/data/action-types:first-container/second-container/third-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - Controller - action-types - third-container", + "tags": [ + "Controller action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - Controller - action-types - third-container", + "tags": [ + "Controller action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - Controller - third-container", + "tags": [ + "Controller action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - Controller - third-container", + "tags": [ + "Controller action-types" + ] + } + }, + "/rests/operations/action-types:first-container/second-container/third-container/nested-action": { + "post": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "input": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input" + } + } + }, + "description": "nested-action_input" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + } + }, + "description": "RPC nested-action success" + } + }, + "summary": "POST - Controller - action-types - nested-action", + "tags": [ + "Controller action-types" + ] + } } }, "components": { @@ -912,6 +1418,71 @@ }, "title": "action-types_container_container-action_output", "type": "object" + }, + "action-types_first-container": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + }, + "title": "action-types_first-container", + "type": "object", + "xml": { + "name": "first-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + }, + "title": "action-types_first-container_second-container", + "type": "object", + "xml": { + "name": "second-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_input": { + "properties": { + "input-leaf": { + "description": "", + "example": "Some input-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_input", + "type": "object", + "xml": { + "name": "input", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_output": { + "properties": { + "output-leaf": { + "description": "", + "example": "Some output-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_output", + "type": "object", + "xml": { + "name": "output", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container": { + "properties": {}, + "title": "action-types_first-container_second-container_third-container", + "type": "object", + "xml": { + "name": "third-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } } }, "securitySchemes": { diff --git a/restconf/restconf-openapi/src/test/resources/yang-document/controller-all.json b/restconf/restconf-openapi/src/test/resources/yang-document/controller-all.json index abe2ec6489..1537833e1c 100644 --- a/restconf/restconf-openapi/src/test/resources/yang-document/controller-all.json +++ b/restconf/restconf-openapi/src/test/resources/yang-document/controller-all.json @@ -11782,6 +11782,512 @@ "summary": "PATCH - typed-params - Controller - enumeration" } }, + "/rests/data/action-types:first-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - Controller - action-types - first-container", + "tags": [ + "Controller action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - Controller - action-types - first-container", + "tags": [ + "Controller action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - Controller - first-container", + "tags": [ + "Controller action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - Controller - action-types - first-container", + "tags": [ + "Controller action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - Controller - first-container", + "tags": [ + "Controller action-types" + ] + } + }, + "/rests/data/action-types:first-container/second-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - Controller - action-types - second-container", + "tags": [ + "Controller action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - Controller - action-types - second-container", + "tags": [ + "Controller action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - Controller - second-container", + "tags": [ + "Controller action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - Controller - action-types - second-container", + "tags": [ + "Controller action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - Controller - second-container", + "tags": [ + "Controller action-types" + ] + } + }, + "/rests/data/action-types:first-container/second-container/third-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - Controller - action-types - third-container", + "tags": [ + "Controller action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - Controller - action-types - third-container", + "tags": [ + "Controller action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - Controller - third-container", + "tags": [ + "Controller action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - Controller - third-container", + "tags": [ + "Controller action-types" + ] + } + }, + "/rests/operations/action-types:first-container/second-container/third-container/nested-action": { + "post": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "input": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input" + } + } + }, + "description": "nested-action_input" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + } + }, + "description": "RPC nested-action success" + } + }, + "summary": "POST - Controller - action-types - nested-action", + "tags": [ + "Controller action-types" + ] + } + }, "/rests/operations/duplication-test:test-rpc": { "post": { "description": "", @@ -13678,6 +14184,71 @@ "title": "test-container-childs_root-container-two-keys_nested-container-two-keys_mandatory-list-two-keys", "type": "object" }, + "action-types_first-container": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + }, + "title": "action-types_first-container", + "type": "object", + "xml": { + "name": "first-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + }, + "title": "action-types_first-container_second-container", + "type": "object", + "xml": { + "name": "second-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_input": { + "properties": { + "input-leaf": { + "description": "", + "example": "Some input-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_input", + "type": "object", + "xml": { + "name": "input", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_output": { + "properties": { + "output-leaf": { + "description": "", + "example": "Some output-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_output", + "type": "object", + "xml": { + "name": "output", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container": { + "properties": {}, + "title": "action-types_first-container_second-container_third-container", + "type": "object", + "xml": { + "name": "third-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, "duplication-test_first": { "properties": {}, "title": "duplication-test_first", diff --git a/restconf/restconf-openapi/src/test/resources/yang-document/device-action-types.json b/restconf/restconf-openapi/src/test/resources/yang-document/device-action-types.json index 2f8676185c..6492afb5d2 100644 --- a/restconf/restconf-openapi/src/test/resources/yang-document/device-action-types.json +++ b/restconf/restconf-openapi/src/test/resources/yang-document/device-action-types.json @@ -791,6 +791,512 @@ "description": "", "summary": "PATCH - action-types - 123 - inner-container" } + }, + "/rests/data/nodes/node=123/yang-ext:mount/action-types:first-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - 123 - action-types - first-container", + "tags": [ + "123 action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - 123 - action-types - first-container", + "tags": [ + "123 action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - 123 - first-container", + "tags": [ + "123 action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - 123 - action-types - first-container", + "tags": [ + "123 action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - 123 - first-container", + "tags": [ + "123 action-types" + ] + } + }, + "/rests/data/nodes/node=123/yang-ext:mount/action-types:first-container/second-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - 123 - action-types - second-container", + "tags": [ + "123 action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - 123 - action-types - second-container", + "tags": [ + "123 action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - 123 - second-container", + "tags": [ + "123 action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - 123 - action-types - second-container", + "tags": [ + "123 action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - 123 - second-container", + "tags": [ + "123 action-types" + ] + } + }, + "/rests/data/nodes/node=123/yang-ext:mount/action-types:first-container/second-container/third-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - 123 - action-types - third-container", + "tags": [ + "123 action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - 123 - action-types - third-container", + "tags": [ + "123 action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - 123 - third-container", + "tags": [ + "123 action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - 123 - third-container", + "tags": [ + "123 action-types" + ] + } + }, + "/rests/operations/nodes/node=123/yang-ext:mount/action-types:first-container/second-container/third-container/nested-action": { + "post": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "input": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input" + } + } + }, + "description": "nested-action_input" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + } + }, + "description": "RPC nested-action success" + } + }, + "summary": "POST - 123 - action-types - nested-action", + "tags": [ + "123 action-types" + ] + } } }, "components": { @@ -912,6 +1418,71 @@ }, "title": "action-types_container_container-action_output", "type": "object" + }, + "action-types_first-container": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + }, + "title": "action-types_first-container", + "type": "object", + "xml": { + "name": "first-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + }, + "title": "action-types_first-container_second-container", + "type": "object", + "xml": { + "name": "second-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_input": { + "properties": { + "input-leaf": { + "description": "", + "example": "Some input-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_input", + "type": "object", + "xml": { + "name": "input", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_output": { + "properties": { + "output-leaf": { + "description": "", + "example": "Some output-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_output", + "type": "object", + "xml": { + "name": "output", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container": { + "properties": {}, + "title": "action-types_first-container_second-container_third-container", + "type": "object", + "xml": { + "name": "third-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } } }, "securitySchemes": { diff --git a/restconf/restconf-openapi/src/test/resources/yang-document/device-all.json b/restconf/restconf-openapi/src/test/resources/yang-document/device-all.json index d12cf1cd74..9fa4f44155 100644 --- a/restconf/restconf-openapi/src/test/resources/yang-document/device-all.json +++ b/restconf/restconf-openapi/src/test/resources/yang-document/device-all.json @@ -11810,6 +11810,512 @@ "summary": "PATCH - action-types - 123 - container" } }, + "/rests/data/nodes/node=123/yang-ext:mount/action-types:first-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - 123 - action-types - first-container", + "tags": [ + "123 action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - 123 - action-types - first-container", + "tags": [ + "123 action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - 123 - first-container", + "tags": [ + "123 action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - 123 - action-types - first-container", + "tags": [ + "123 action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:first-container": { + "$ref": "#/components/schemas/action-types_first-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container" + } + } + }, + "description": "first-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - 123 - first-container", + "tags": [ + "123 action-types" + ] + } + }, + "/rests/data/nodes/node=123/yang-ext:mount/action-types:first-container/second-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - 123 - action-types - second-container", + "tags": [ + "123 action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - 123 - action-types - second-container", + "tags": [ + "123 action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - 123 - second-container", + "tags": [ + "123 action-types" + ] + }, + "post": { + "description": "\n\nNote:\nIn example payload, you can see only the first data node child of the resource to be created, following the\nguidelines of RFC 8040, which allows us to create only one resource in POST request.\n", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + } + }, + "summary": "POST - 123 - action-types - second-container", + "tags": [ + "123 action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + } + }, + "description": "second-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - 123 - second-container", + "tags": [ + "123 action-types" + ] + } + }, + "/rests/data/nodes/node=123/yang-ext:mount/action-types:first-container/second-container/third-container": { + "delete": { + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "Deleted" + } + }, + "summary": "DELETE - 123 - action-types - third-container", + "tags": [ + "123 action-types" + ] + }, + "get": { + "description": "", + "parameters": [ + { + "name": "content", + "in": "query", + "required": false, + "schema": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "200" + } + }, + "summary": "GET - 123 - action-types - third-container", + "tags": [ + "123 action-types" + ] + }, + "patch": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/yang-data+json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/yang-data+xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PATCH - action-types - 123 - third-container", + "tags": [ + "123 action-types" + ] + }, + "put": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "action-types:third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + } + }, + "description": "third-container" + }, + "responses": { + "201": { + "description": "Created" + }, + "204": { + "description": "Updated" + } + }, + "summary": "PUT - action-types - 123 - third-container", + "tags": [ + "123 action-types" + ] + } + }, + "/rests/operations/nodes/node=123/yang-ext:mount/action-types:first-container/second-container/third-container/nested-action": { + "post": { + "description": "", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "input": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input", + "type": "object" + } + } + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_input" + } + } + }, + "description": "nested-action_input" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + }, + "application/xml": { + "schema": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container_nested-action_output" + } + } + }, + "description": "RPC nested-action success" + } + }, + "summary": "POST - 123 - action-types - nested-action", + "tags": [ + "123 action-types" + ] + } + }, "/rests/operations/nodes/node=123/yang-ext:mount/duplication-test:test-rpc": { "post": { "description": "", @@ -13706,6 +14212,71 @@ "title": "test-container-childs_root-container-two-keys_nested-container-two-keys_mandatory-list-two-keys", "type": "object" }, + "action-types_first-container": { + "properties": { + "second-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container" + } + }, + "title": "action-types_first-container", + "type": "object", + "xml": { + "name": "first-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container": { + "properties": { + "third-container": { + "$ref": "#/components/schemas/action-types_first-container_second-container_third-container" + } + }, + "title": "action-types_first-container_second-container", + "type": "object", + "xml": { + "name": "second-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_input": { + "properties": { + "input-leaf": { + "description": "", + "example": "Some input-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_input", + "type": "object", + "xml": { + "name": "input", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container_nested-action_output": { + "properties": { + "output-leaf": { + "description": "", + "example": "Some output-leaf", + "type": "string" + } + }, + "title": "action-types_first-container_second-container_third-container_nested-action_output", + "type": "object", + "xml": { + "name": "output", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, + "action-types_first-container_second-container_third-container": { + "properties": {}, + "title": "action-types_first-container_second-container_third-container", + "type": "object", + "xml": { + "name": "third-container", + "namespace": "urn:ietf:params:xml:ns:yang:test:action:types" + } + }, "duplication-test_first": { "properties": {}, "title": "duplication-test_first", diff --git a/restconf/restconf-openapi/src/test/resources/yang/action-types.yang b/restconf/restconf-openapi/src/test/resources/yang/action-types.yang index 4d6d316e3e..21819a1f47 100644 --- a/restconf/restconf-openapi/src/test/resources/yang/action-types.yang +++ b/restconf/restconf-openapi/src/test/resources/yang/action-types.yang @@ -47,4 +47,23 @@ module action-types { } } } + + container first-container { + container second-container { + container third-container { + action nested-action { + input { + leaf input-leaf { + type string; + } + } + output { + leaf output-leaf { + type string; + } + } + } + } + } + } } -- 2.36.6