Skip to content

Commit

Permalink
Merge pull request #4 from Ramky-Infoblox/pagination
Browse files Browse the repository at this point in the history
Added _is_total_size_needed swagger documentation
  • Loading branch information
drewwells authored Dec 11, 2024
2 parents f14c5b8 + 671b124 commit 9d8d785
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
# Dependency directories (remove the comment below to include it)
vendor/

# goland IDE stuff
/.idea

# Mac specific files
.DS_Store

**/*.emitted.swagger.json
**/*.emitted.private.swagger.json
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -20,7 +21,9 @@ github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -35,18 +38,22 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY=
golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe h1:WdX7u8s3yOigWAhHEaDl8r9G+4XwFQEQFtBMYyN+kXQ=
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
"description": "\n\nThe service-defined string used to identify a page of resources. A null value indicates the first page.\n\n\t\t\t\t\t\t\t",
"name": "_page_token",
"in": "query"
},
{
"type": "boolean",
"description": "\n\nThis parameter controls whether the total record count is included in the response. If not specified, it defaults to false.\n\n\t\t\t\t\t\t\t",
"name": "_is_total_size_needed",
"in": "query"
}
],
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
"description": "\n\nThe service-defined string used to identify a page of resources. A null value indicates the first page.\n\n\t\t\t\t\t\t\t",
"name": "_page_token",
"in": "query"
},
{
"type": "boolean",
"description": "\n\nThis parameter controls whether the total record count is included in the response. If not specified, it defaults to false.\n\n\t\t\t\t\t\t\t",
"name": "_is_total_size_needed",
"in": "query"
}
],
"responses": {
Expand Down
6 changes: 6 additions & 0 deletions internal/testdata/atlaspatch.wanted.private.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
"description": "\n\nThe service-defined string used to identify a page of resources. A null value indicates the first page.\n\n\t\t\t\t\t\t\t",
"name": "_page_token",
"in": "query"
},
{
"type": "boolean",
"description": "\n\nThis parameter controls whether the total record count is included in the response. If not specified, it defaults to false.\n\n\t\t\t\t\t\t\t",
"name": "_is_total_size_needed",
"in": "query"
}
],
"responses": {
Expand Down
6 changes: 6 additions & 0 deletions internal/testdata/atlaspatch.wanted.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
"description": "\n\nThe service-defined string used to identify a page of resources. A null value indicates the first page.\n\n\t\t\t\t\t\t\t",
"name": "_page_token",
"in": "query"
},
{
"type": "boolean",
"description": "\n\nThis parameter controls whether the total record count is included in the response. If not specified, it defaults to false.\n\n\t\t\t\t\t\t\t",
"name": "_is_total_size_needed",
"in": "query"
}
],
"responses": {
Expand Down
6 changes: 6 additions & 0 deletions internal/testdata/jeepsvc.in.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
"name": "_page_token",
"in": "query"
},
{
"type": "boolean",
"description": "\n\nThis parameter controls whether the total record count is included in the response. If not specified, it defaults to false.\n\n\t\t\t\t\t\t\t",
"name": "_is_total_size_needed",
"in": "query"
},
{
"type": "string",
"description": "\n\nA collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.)\n\nSpecify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order.\n\n\t\t\t\t\t\t",
Expand Down
6 changes: 6 additions & 0 deletions internal/testdata/jeepsvc.wanted.customresponses.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
"name": "_page_token",
"in": "query"
},
{
"type": "boolean",
"description": "\n\nThis parameter controls whether the total record count is included in the response. If not specified, it defaults to false.\n\n\t\t\t\t\t\t\t",
"name": "_is_total_size_needed",
"in": "query"
},
{
"type": "string",
"description": "\n\nA collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.)\n\nSpecify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order.\n\n\t\t\t\t\t\t",
Expand Down
5 changes: 5 additions & 0 deletions pkg/svc/atlas_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ The integer number of resources to be returned in the response. The service may
The service-defined string used to identify a page of resources. A null value indicates the first page.
`).Typed("string", ""),
*(spec.QueryParam("_is_total_size_needed")).WithDescription(`
This parameter controls whether the total record count is included in the response. If not specified, it defaults to false.
`).Typed("boolean", ""),
)
// Skip ID
default:
Expand Down

0 comments on commit 9d8d785

Please sign in to comment.