Skip to content

Commit ae90418

Browse files
authored
feat(158): add next_page_token support (#64)
next_page_token was missing, and is a required part of the AEP.
1 parent 9f07c61 commit ae90418

5 files changed

Lines changed: 24 additions & 2 deletions

File tree

example/bookstore/v1/bookstore_openapi.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"schema": {
4444
"type": "object",
4545
"properties": {
46+
"next_page_token": {
47+
"type": "string"
48+
},
4649
"results": {
4750
"type": "array",
4851
"items": {
@@ -162,6 +165,9 @@
162165
"schema": {
163166
"type": "object",
164167
"properties": {
168+
"next_page_token": {
169+
"type": "string"
170+
},
165171
"results": {
166172
"type": "array",
167173
"items": {
@@ -378,6 +384,9 @@
378384
"schema": {
379385
"type": "object",
380386
"properties": {
387+
"next_page_token": {
388+
"type": "string"
389+
},
381390
"results": {
382391
"type": "array",
383392
"items": {
@@ -648,6 +657,9 @@
648657
"schema": {
649658
"type": "object",
650659
"properties": {
660+
"next_page_token": {
661+
"type": "string"
662+
},
651663
"results": {
652664
"type": "array",
653665
"items": {

example/bookstore/v1/bookstore_openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ paths:
125125
application/json:
126126
schema:
127127
properties:
128+
next_page_token:
129+
type: string
128130
results:
129131
items:
130132
$ref: '#/components/schemas/isbn'
@@ -196,6 +198,8 @@ paths:
196198
application/json:
197199
schema:
198200
properties:
201+
next_page_token:
202+
type: string
199203
results:
200204
items:
201205
$ref: '#/components/schemas/publisher'
@@ -327,6 +331,8 @@ paths:
327331
application/json:
328332
schema:
329333
properties:
334+
next_page_token:
335+
type: string
330336
results:
331337
items:
332338
$ref: '#/components/schemas/book'
@@ -492,6 +498,8 @@ paths:
492498
application/json:
493499
schema:
494500
properties:
501+
next_page_token:
502+
type: string
495503
results:
496504
items:
497505
$ref: '#/components/schemas/book-edition'

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
2020
github.com/PuerkitoBio/purell v1.1.0 // indirect
2121
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
22-
github.com/aep-dev/aep-lib-go v0.0.0-20250121233519-8bc026ce637e // indirect
22+
github.com/aep-dev/aep-lib-go v0.0.0-20250223051210-bfe8118a440e // indirect
2323
github.com/aep-dev/terraform-provider-aep v0.0.0-20241112052633-f48d45460768 // indirect
2424
github.com/agext/levenshtein v1.2.2 // indirect
2525
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ github.com/aep-dev/aep-lib-go v0.0.0-20250121232515-a2a291f11702 h1:MgtMJpM68Ht3
9292
github.com/aep-dev/aep-lib-go v0.0.0-20250121232515-a2a291f11702/go.mod h1:M+h1D6T2uIUPelmaEsJbjR6JhqKsTlPX3lxp25zQQsk=
9393
github.com/aep-dev/aep-lib-go v0.0.0-20250121233519-8bc026ce637e h1:fwCEENQV0LVH/HEkn6Egznu9FzsifNwnIW7qoYvs5jw=
9494
github.com/aep-dev/aep-lib-go v0.0.0-20250121233519-8bc026ce637e/go.mod h1:M+h1D6T2uIUPelmaEsJbjR6JhqKsTlPX3lxp25zQQsk=
95+
github.com/aep-dev/aep-lib-go v0.0.0-20250223051210-bfe8118a440e h1:iCpaywIt5gpbraG4puKR0/p0cbdMILKc8DLl1v01/30=
96+
github.com/aep-dev/aep-lib-go v0.0.0-20250223051210-bfe8118a440e/go.mod h1:M+h1D6T2uIUPelmaEsJbjR6JhqKsTlPX3lxp25zQQsk=
9597
github.com/aep-dev/terraform-provider-aep v0.0.0-20241112052633-f48d45460768 h1:b5fRfpIIsOsdsT2N1MsBxr0K/fZacCUlWp0uY9/BJzM=
9698
github.com/aep-dev/terraform-provider-aep v0.0.0-20241112052633-f48d45460768/go.mod h1:sUuUJSkWTc4GBxp8GEZXCeEI38VMyuM5msPQ9BG0kMA=
9799
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=

writer/proto/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func addResourceField(r *api.Resource, resourceMb, mb *builder.MessageBuilder) {
609609
}
610610

611611
func addResourcesField(r *api.Resource, resourceMb, mb *builder.MessageBuilder) {
612-
f := builder.NewField("results", builder.FieldTypeMessage(resourceMb)).SetNumber(constants.FIELD_RESOURCES_NUMBER).SetComments(builder.Comments{
612+
f := builder.NewField(constants.FIELD_RESULTS_NAME, builder.FieldTypeMessage(resourceMb)).SetNumber(constants.FIELD_RESULTS_NUMBER).SetComments(builder.Comments{
613613
LeadingComment: fmt.Sprintf("A list of %v", r.Plural),
614614
}).SetRepeated()
615615
mb.AddField(f)

0 commit comments

Comments
 (0)