Skip to content

No default value assigned by code generation #14

Description

@acloudiator

in some cases, described below, yang default parameter is not taken into account by code generation.

Case1 (working):

leaf pathcost {
  type int32;
  default 1;
  description "Cost of this route";
  router:cli-example "10";
}
int32_t m_pathcost;
m_pathcost = 1;

Case2 (not working):

leaf pathcost {
  type uint32;
  default 1;
  description "Cost of this route";
  router:cli-example "10";
}
//No default value is generated by codegen
uint32_t m_pathcost;

Case3 (not working):

leaf pathcost {
  type string;
  default "1";
  description "Cost of this route";
  router:cli-example "10";
}
std::string m_pathcost;
m_pathcost = 1; // it should be a string, so "1"

Case4 (not working):

leaf pathcost {
  type uint8;
  default 1;
  description "Cost of this route";
  router:cli-example "10";
}
uint8_t m_pathcost;
// no default value is set
  • Matteo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions