assert (leafNode instanceof AnydataSchemaNode || leafNode instanceof AnyxmlSchemaNode);
final var leafDescription = leafNode.getDescription().orElse("");
- generator.writeStringField(DESCRIPTION, leafDescription);
+ generator.writeStringField(DESCRIPTION,
+ leafDescription + " (This is unknown data, need to be filled by user.)");
- final var localName = leafNode.getQName().getLocalName();
- generator.writeStringField(EXAMPLE, String.format("<%s> ... </%s>", localName, localName));
- generator.writeStringField(TYPE, STRING_TYPE);
+ generator.writeObjectFieldStart(EXAMPLE);
+ generator.writeEndObject();
+ generator.writeStringField(TYPE, OBJECT_TYPE);
if (!leafNode.getQName().getNamespace().equals(parentNamespace)) {
// If the parent is not from the same model, define the child XML namespace.
buildXmlParameter(leafNode);
],
"parameters": []
}
+ },
+ "/rests/data/typed-params:typed/anydata={key}": {
+ "put": {
+ "description": "",
+ "summary": "PUT - typed-params - Controller - anydata",
+ "requestBody": {
+ "description": "anydata",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ }
+ }
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "Created"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "patch": {
+ "description": "",
+ "summary": "PATCH - typed-params - Controller - anydata",
+ "requestBody": {
+ "description": "anydata",
+ "content": {
+ "application/yang-data+json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ }
+ }
+ }
+ }
+ },
+ "application/yang-data+xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "delete": {
+ "description": "",
+ "summary": "DELETE - Controller - typed-params - anydata",
+ "responses": {
+ "204": {
+ "description": "Deleted"
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "get": {
+ "description": "",
+ "summary": "GET - Controller - typed-params - anydata",
+ "responses": {
+ "200": {
+ "description": "200",
+ "content": {
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "properties": {
+ "anydata": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "content",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "config",
+ "nonconfig",
+ "all"
+ ],
+ "type": "string"
+ }
+ }
+ ]
+ }
}
},
"components": {
"items": {
"$ref": "#/components/schemas/typed-params_typed_uint32"
}
+ },
+ "anydata": {
+ "description": "",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ },
+ "type": "array"
}
},
"xml": {
"name": "output",
"namespace": "urn:ietf:params:xml:ns:yang:test:action:types"
}
+ },
+ "typed-params_typed_anydata": {
+ "properties": {
+ "key": {
+ "description": "",
+ "example": "Some key",
+ "type": "string"
+ },
+ "value": {
+ "description": "Anydata value. (This is unknown data, need to be filled by user.)",
+ "example": {},
+ "type": "object"
+ }
+ },
+ "title": "typed-params_typed_anydata",
+ "type": "object",
+ "xml": {
+ "name": "anydata",
+ "namespace": "urn:typed-params"
+ }
}
},
"securitySchemes": {
"description": "",
"summary": "PATCH - typed-params - Controller - enumeration"
}
+ },
+ "/rests/data/typed-params:typed/anydata={key}": {
+ "put": {
+ "description": "",
+ "summary": "PUT - typed-params - Controller - anydata",
+ "requestBody": {
+ "description": "anydata",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ }
+ }
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "Created"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "patch": {
+ "description": "",
+ "summary": "PATCH - typed-params - Controller - anydata",
+ "requestBody": {
+ "description": "anydata",
+ "content": {
+ "application/yang-data+json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ }
+ }
+ }
+ }
+ },
+ "application/yang-data+xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "delete": {
+ "description": "",
+ "summary": "DELETE - Controller - typed-params - anydata",
+ "responses": {
+ "204": {
+ "description": "Deleted"
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "get": {
+ "description": "",
+ "summary": "GET - Controller - typed-params - anydata",
+ "responses": {
+ "200": {
+ "description": "200",
+ "content": {
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ },
+ "application/json": {
+ "schema": {
+ "properties": {
+ "anydata": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Controller typed-params"
+ ],
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "content",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "config",
+ "nonconfig",
+ "all"
+ ],
+ "type": "string"
+ }
+ }
+ ]
+ }
}
},
"components": {
"items": {
"$ref": "#/components/schemas/typed-params_typed_int16"
}
+ },
+ "anydata": {
+ "description": "",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ },
+ "type": "array"
}
},
"xml": {
},
"title": "typed-params_typed_string",
"type": "object"
+ },
+ "typed-params_typed_anydata": {
+ "properties": {
+ "key": {
+ "description": "",
+ "example": "Some key",
+ "type": "string"
+ },
+ "value": {
+ "description": "Anydata value. (This is unknown data, need to be filled by user.)",
+ "example": {},
+ "type": "object"
+ }
+ },
+ "title": "typed-params_typed_anydata",
+ "type": "object",
+ "xml": {
+ "name": "anydata",
+ "namespace": "urn:typed-params"
+ }
}
},
"securitySchemes": {
],
"parameters": []
}
+ },
+ "/rests/data/nodes/node=123/yang-ext:mount/typed-params:typed/anydata={key}": {
+ "delete": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Deleted"
+ }
+ },
+ "summary": "DELETE - 123 - typed-params - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ },
+ "get": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "content",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "config",
+ "nonconfig",
+ "all"
+ ],
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "anydata": {
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ },
+ "type": "array"
+ }
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ },
+ "description": "200"
+ }
+ },
+ "summary": "GET - 123 - typed-params - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ },
+ "patch": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/yang-data+json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ },
+ "type": "array"
+ }
+ }
+ }
+ },
+ "application/yang-data+xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ },
+ "description": "anydata"
+ },
+ "responses": {
+ "200": {
+ "description": "OK"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "summary": "PATCH - typed-params - 123 - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ },
+ "put": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ },
+ "type": "array"
+ }
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ },
+ "description": "anydata"
+ },
+ "responses": {
+ "201": {
+ "description": "Created"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "summary": "PUT - typed-params - 123 - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ }
}
},
"components": {
"items": {
"$ref": "#/components/schemas/typed-params_typed_bits"
}
+ },
+ "anydata": {
+ "description": "",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ },
+ "type": "array"
}
},
"xml": {
"name": "output",
"namespace": "urn:ietf:params:xml:ns:yang:test:action:types"
}
+ },
+ "typed-params_typed_anydata": {
+ "properties": {
+ "key": {
+ "description": "",
+ "example": "Some key",
+ "type": "string"
+ },
+ "value": {
+ "description": "Anydata value. (This is unknown data, need to be filled by user.)",
+ "example": {},
+ "type": "object"
+ }
+ },
+ "title": "typed-params_typed_anydata",
+ "type": "object",
+ "xml": {
+ "name": "anydata",
+ "namespace": "urn:typed-params"
+ }
}
},
"securitySchemes": {
"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",
"summary": "POST - 123 - typed-params - typed-params"
}
+ },
+ "/rests/data/nodes/node=123/yang-ext:mount/typed-params:typed/anydata={key}": {
+ "delete": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Deleted"
+ }
+ },
+ "summary": "DELETE - 123 - typed-params - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ },
+ "get": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "content",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "enum": [
+ "config",
+ "nonconfig",
+ "all"
+ ],
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "anydata": {
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ },
+ "type": "array"
+ }
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ },
+ "description": "200"
+ }
+ },
+ "summary": "GET - 123 - typed-params - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ },
+ "patch": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/yang-data+json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ },
+ "type": "array"
+ }
+ }
+ }
+ },
+ "application/yang-data+xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ },
+ "description": "anydata"
+ },
+ "responses": {
+ "200": {
+ "description": "OK"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "summary": "PATCH - typed-params - 123 - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ },
+ "put": {
+ "description": "",
+ "parameters": [
+ {
+ "name": "key",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "typed-params:anydata": {
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata",
+ "type": "object"
+ },
+ "type": "array"
+ }
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ }
+ }
+ },
+ "description": "anydata"
+ },
+ "responses": {
+ "201": {
+ "description": "Created"
+ },
+ "204": {
+ "description": "Updated"
+ }
+ },
+ "summary": "PUT - typed-params - 123 - anydata",
+ "tags": [
+ "123 typed-params"
+ ]
+ }
}
},
"components": {
"items": {
"$ref": "#/components/schemas/typed-params_typed_int16"
}
+ },
+ "anydata": {
+ "description": "",
+ "items": {
+ "$ref": "#/components/schemas/typed-params_typed_anydata"
+ },
+ "type": "array"
}
},
"xml": {
},
"title": "typed-params_typed_string",
"type": "object"
+ },
+ "typed-params_typed_anydata": {
+ "properties": {
+ "key": {
+ "description": "",
+ "example": "Some key",
+ "type": "string"
+ },
+ "value": {
+ "description": "Anydata value. (This is unknown data, need to be filled by user.)",
+ "example": {},
+ "type": "object"
+ }
+ },
+ "title": "typed-params_typed_anydata",
+ "type": "object",
+ "xml": {
+ "name": "anydata",
+ "namespace": "urn:typed-params"
+ }
}
},
"securitySchemes": {
type string;
}
}
+ list anydata {
+ key key;
+ leaf key {
+ type string;
+ }
+ anydata value {
+ description "Anydata value.";
+ }
+ }
}
}
\ No newline at end of file