Added error handling in yang_path_arg triggered by no filter in get paginated

Fixed cornercase of restconf error return when no body
Fixed cornercase when exactly / given as xpath
Better error message when YANG not found: added which YANG file imports it
This commit is contained in:
Olof hagsand 2021-11-09 20:02:40 +01:00
parent a4b4dc97ce
commit 2dcc14a0db
9 changed files with 39 additions and 14 deletions

View file

@ -467,7 +467,7 @@ get_list_pagination(clicon_handle h,
#endif
/* Check if list/leaf-list */
if (yang_path_arg(yspec, xpath, &ylist) < 0)
if (yang_path_arg(yspec, xpath?xpath:"/", &ylist) < 0)
goto done;
if (ylist == NULL){
if ((cbmsg = cbuf_new()) == NULL){

View file

@ -84,7 +84,7 @@ typedef struct {
*/
typedef struct {
uint32_t pd_offset; /* Start of pagination interval */
uint32_t pd_limit; /* Number of elemenents (limit) */
uint32_t pd_limit; /* Number of elements (limit) */
int pd_locked; /* Running datastore is locked by this caller */
cxobj *pd_xstate; /* Returned xml state tree */
} pagination_data_t;

View file

@ -286,7 +286,6 @@ transaction_log(clicon_handle h,
return 0;
}
/*! Get pagination data: offset parameter
*
* @param[in] pd Pagination userdata