Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: WEOS-1308 As a developer I should be able to add data to the context via the api sepcification #116

Merged
merged 25 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ffdb976
feature: WEOS-1308 Generate and ensure BDD Test is passing
shaniah868 Feb 21, 2022
a39f3eb
feature: WEOS-1308 Generate and ensure BDD Test is passing
shaniah868 Feb 21, 2022
bf9415a
feature: WEOS-1308 Update the context middleware to take parameters f…
shaniah868 Feb 21, 2022
27cadb2
Merge branch 'WEOS-1369' into WEOS-1370
shaniah868 Feb 22, 2022
9ead050
feature: WEOS-1308 Generate and ensure BDD Test is passing
shaniah868 Feb 22, 2022
65ce97c
feature: WEOS-1308 Generate and ensure BDD Test is passing
shaniah868 Feb 22, 2022
e0c92e1
feature: WEOS-1308 Generate and ensure BDD Test is passing
shaniah868 Feb 22, 2022
a83bda0
Merge pull request #114 from wepala/WEOS-1370
atoniaw Feb 22, 2022
6b1abea
Merge branch 'dev' into feature/WEOS-1308
shaniah868 Feb 22, 2022
97ee255
feature: WEOS-1308 Update the context middleware to take parameters f…
shaniah868 Feb 23, 2022
f481548
Merge branch 'feature/WEOS-1308' into WEOS-1369
shaniah868 Feb 23, 2022
3e1cb87
feature: WEOS-1308 Update the context middleware to take parameters f…
shaniah868 Feb 24, 2022
cbcdb99
feature: WEOS-1308 Update the context middleware to take parameters f…
shaniah868 Feb 24, 2022
39ade57
feature: WEOS-1308 Update the context middleware to take parameters f…
shaniah868 Feb 24, 2022
632cee4
Merge pull request #120 from wepala/WEOS-1369
atoniaw Feb 24, 2022
ae70c29
feature: WEOS-1308 As a developer I should be able to add data to the…
shaniah868 Feb 28, 2022
5198df1
Merge branch 'dev' into feature/WEOS-1308
shaniah868 Feb 28, 2022
110c8ea
Merge branch 'dev' into feature/WEOS-1308
shaniah868 Mar 2, 2022
f6a4842
Merge branch 'dev' into feature/WEOS-1308
shaniah868 Mar 2, 2022
be0d6e6
feature: WEOS-1365 As a developer I should be able set an example to …
shaniah868 Mar 4, 2022
0c4a0ae
feature: WEOS-1365 As a developer I should be able set an example to …
shaniah868 Mar 4, 2022
f4434c4
feature: WEOS-1308 As a developer I should be able to add data to the…
shaniah868 Mar 7, 2022
5b71018
Merge branch 'dev' into feature/WEOS-1308
shaniah868 Mar 7, 2022
b847bbb
feature: WEOS-1308 As a developer I should be able to add data to the…
shaniah868 Mar 7, 2022
93850c4
feature: WEOS-1308 As a developer I should be able to add data to the…
shaniah868 Mar 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,24 +258,10 @@ paths:
required: false
description: query string
x-context:
filters:
- field: status
_filters:
- field: active
operator: eq
values:
- Active
- field: lastUpdated
operator: between
values:
- 2021-12-17 15:46:00
- 2021-12-18 15:46:00
- field: categories
operator: in
values:
- Technology
- Javascript
sorts:
- field: title
order: asc
value: true
page: 1
limit: 10
responses:
Expand Down
2 changes: 1 addition & 1 deletion controllers/rest/controller_standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ func DefaultResponseController(api *RESTAPI, projection projections.Projection,
newContext := context.Request().Context()
value := newContext.Value("resp")
if value == nil {
return NewControllerError("unexpected error all responses were parsed, nothing was found", nil, http.StatusBadRequest)
return nil
}
return value.(error)
}
Expand Down
12 changes: 12 additions & 0 deletions controllers/rest/controller_standard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ func TestStandardControllers_CreateBatch(t *testing.T) {
NameFunc: func() string {
return "Blog"
},
SchemaFunc: func() *openapi3.Schema {
return swagger.Components.Schemas["Blog"].Value
},
}

t.Run("basic batch create based on simple content type", func(t *testing.T) {
Expand Down Expand Up @@ -1392,6 +1395,9 @@ func TestStandardControllers_FormUrlEncoded_Create(t *testing.T) {
NameFunc: func() string {
return "Blog"
},
SchemaFunc: func() *openapi3.Schema {
return swagger.Components.Schemas["Blog"].Value
},
}
eventRepository := &EventRepositoryMock{}

Expand Down Expand Up @@ -1551,6 +1557,9 @@ func TestStandardControllers_FormData_Create(t *testing.T) {
NameFunc: func() string {
return "Blog"
},
SchemaFunc: func() *openapi3.Schema {
return swagger.Components.Schemas["Blog"].Value
},
}

t.Run("basic create based on multipart/form-data content type", func(t *testing.T) {
Expand Down Expand Up @@ -1717,6 +1726,9 @@ func TestStandardControllers_DeleteEtag(t *testing.T) {
NameFunc: func() string {
return "Blog"
},
SchemaFunc: func() *openapi3.Schema {
return swagger.Components.Schemas["Blog"].Value
},
}
resp := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodDelete, "/blogs/"+weosId, nil)
Expand Down
8 changes: 5 additions & 3 deletions controllers/rest/fixtures/blog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ paths:
required: false
description: query string
x-context:
filters:
_filters:
- field: status
operator: eq
values:
value:
- Active
- field: lastUpdated
operator: between
Expand All @@ -284,7 +284,7 @@ paths:
values:
- Technology
- Javascript
sorts:
_sorts:
- field: title
order: asc
page: 1
Expand Down Expand Up @@ -350,6 +350,8 @@ paths:
schema:
type: number
format: double
x-context:
id: 2
summary: Get Blog by id
operationId: Get Blog
responses:
Expand Down
Loading