[NETCONF-1179] OpenApi Remove processModule method from DefinitionGenerator Created: 06/Oct/23  Updated: 02/Nov/23  Resolved: 02/Nov/23

Status: Resolved
Project: netconf
Component/s: restconf-openapi
Affects Version/s: None
Fix Version/s: 7.0.0, 4.0.9, 6.0.5, 5.0.10

Type: Bug Priority: Medium
Reporter: Peter Suna Assignee: Oleksandr Zharov
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The `processModule` method is invoked only when a specific single model is requested directly, using the following URL: 
http://localhost:8181/openapi/api/v3/mounts/1/MODEL(REVISION)

However, this method generates a POST request with an incorrect payload, resulting in a 500 error response with the following message:
"Error parsing json input: Failed to create new parse result data. Are you creating multiple resources/subresources in POST request?"

This issue is caused by writing two resources at the same time.

"/rests/data/network-topology:network-topology/topology=topology-netconf/node=36001-sim-device/yang-ext:mount": {
  "post": {
    "requestBody": {
      "description": "second-test-containers_module",
      "content": {
        "application/xml": {
          "schema": {
            "$ref": "#/components/schemas/second-test-containers_module"
          }
        },
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/second-test-containers_module"
          }
        }
      }
    },
    "responses": {
      "201": {
        "description": "Created"
      }
    }
  }
}
"second-test-containers_module": {
  "required": [
    "foo",
    "bar"
  ],
  "properties": {
    "foo": {
      "$ref": "#/components/schemas/second-test-containers_foo"
    },
    "bar": {
      "$ref": "#/components/schemas/second-test-containers_bar"
    }
  },
  "description": "",
  "title": "second-test-containers_module",
  "type": "object"
}

So there is no need to create a schema "second-test-containers_module".

Instead, use the first container in the model in the POST reference. In this case, "second-test-containers_foo".


Generated at Wed Feb 07 20:16:52 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.