Skip to content

Not showing required fields in swagger #33

@jdillard

Description

@jdillard

The mandatory fields don't appear in the generated swagger file when using the CLI. This YANG model:

rpc system-ping {
	input {
	    leaf destination {
		mandatory true;
		type union {
		    type inet:domain-name;
		    type inet:ip-address-no-zone;
		}
		description
		    "Destination being pinged.";
	    }
	    leaf packet-size {
		type uint32;
		description
		    "Ping packet (data) size";
	    }
	}

produces the following:

system.systemping.Input:
    type: "object"
    properties:
      packet-size:
        type: "integer"
        format: "int64"
        description: "Ping packet (data) size"
      destination:
        type: "string"
        description: "Destination being pinged."

but it should produce the following:

system.systemping.Input:
    type: "object"
    required:  # <--- List the required properties here
      - destination
    properties:
      packet-size:
        type: "integer"
        format: "int64"
        description: "Ping packet (data) size"
      destination:
        type: "string"
        description: "Destination being pinged."

Edit: Changed wording from question to statement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions