Skip to content

Commit

Permalink
Add feature "sort"
Browse files Browse the repository at this point in the history
This feature indicates support for "locale", "sort-by", and "direction".

Fixes: #28
  • Loading branch information
avtobiff committed Nov 22, 2024
1 parent 25c424c commit e752336
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions draft-ietf-netconf-list-pagination.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@
<t>The sorting can furthermore be configured with a locale for
sorting. This is done by setting the "locale" parameter
(see <xref target="locale"/>).</t>
<t>The feature "sort" is used to indicate support for the query
parameters "locale", "sort-by", and "direction".</t>

<section title='The "where" Query Parameter' anchor="where" toc="exclude">
<dl newline="true">
Expand Down
12 changes: 12 additions & 0 deletions ietf-list-pagination.yang
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ module ietf-list-pagination {
"RFC XXXX: List Pagination for YANG-driven Protocols";
}

// Features

feature sort {
description
'This feature indicates that the parameters "locale", "sort-by",
and "direction" are supported.';
}

// Annotations

Expand Down Expand Up @@ -112,6 +119,7 @@ module ietf-list-pagination {
}

md:annotation locale {
if-feature "sort";
type string;
description
"This annotation contains the locale used when sorting.
Expand Down Expand Up @@ -148,6 +156,7 @@ module ietf-list-pagination {
}

identity locale-unavailable {
if-feature "sort";
base list-pagination-error;
description
"The 'locale' query parameter input is not a valid
Expand Down Expand Up @@ -187,12 +196,14 @@ module ietf-list-pagination {
statement applied to it (see RFC XXXX).";
}
leaf locale {
if-feature "sort";
type string;
description
"The 'locale' parameter indicates the locale which the
entries in the working result-set should be collated.";
}
leaf sort-by {
if-feature "sort";
type union {
type string {
// An RFC 7950 'descendant-schema-nodeid'.
Expand All @@ -219,6 +230,7 @@ module ietf-list-pagination {
the end (e.g., after all nodes having values).";
}
leaf direction {
if-feature "sort";
type enumeration {
enum forwards {
description
Expand Down

0 comments on commit e752336

Please sign in to comment.