pyang-json-schema-plugin icon indicating copy to clipboard operation
pyang-json-schema-plugin copied to clipboard

Mandatory Field doesn't seem to be mapping to the JSON Schema "required" field

Open manny-atx opened this issue 2 years ago • 1 comments

Adding leaf nodes under a list property I have doesn't seem to be mapping to the JSON Schema required fields.

Input:

    container interfaces {
        list interface {
            key name;
            leaf name {
                type string;
                mandatory true;
                description "Interface name. Example value: GigabitEthernet 0/0/0";
            }
        }
}

Output:

{
	"title": "ultraconfig-interfaces",
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "Generated by pyang from module ultraconfig-interfaces",
	"type": "object",
	"properties": {
		"ultraconfig-interfaces:interfaces": {
			"type": "object",
			"properties": {
				"interface": {
					"type": "array",
					"items": [{
						"name": {
							"type": "string"
						}
					}]
				}
			}
		}
	}
}

manny-atx avatar Apr 14 '22 19:04 manny-atx

how you are running this do you have any steps for this

rahul12130 avatar Jul 14 '23 10:07 rahul12130