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

Improve error messages for invalid variables (jsonschema) #372

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
289bb38
Update pkg/variablevalidator/variablevalidator.go
sweep-ai[bot] Aug 7, 2023
9ecd551
Update pkg/variablevalidator/variablevalidator.go
sweep-ai[bot] Aug 7, 2023
513bbfe
Update pkg/variablevalidator/variablevalidator.go
sweep-ai[bot] Aug 7, 2023
b50400c
Update pkg/variablevalidator/variablevalidator.go
sweep-ai[bot] Aug 7, 2023
4457940
Update pkg/variablevalidator/variablevalidator_test.go
sweep-ai[bot] Aug 7, 2023
d3a6bfa
Update pkg/variablevalidator/variablevalidator.go
sweep-ai[bot] Aug 7, 2023
525439e
Update pkg/variablevalidator/variablevalidator_test.go
sweep-ai[bot] Aug 8, 2023
b68f2a5
Update pkg/variablevalidator/variablevalidator_test.go
sweep-ai[bot] Aug 8, 2023
75023c1
Merge main into sweep/improve-error-messages
sweep-ai[bot] Aug 9, 2023
46d54d9
Updated pkg/subscription/handler_test.go
sweep-ai[bot] Aug 9, 2023
4a6005c
sweep: Create pkg/subscription/timeout_handler.go
sweep-ai[bot] Aug 9, 2023
ddb5ff9
Updated pkg/openapi/openapi_test.go
sweep-ai[bot] Aug 9, 2023
1647874
Updated pkg/openapi/fixtures/v3.0.0/example_oas7.graphql
sweep-ai[bot] Aug 9, 2023
b625b1f
Updated pkg/subscription/handler_test.go
sweep-ai[bot] Aug 9, 2023
80fa5fd
Updated pkg/openapi/openapi_test.go
sweep-ai[bot] Aug 9, 2023
c530087
Updated pkg/openapi/openapi.go
sweep-ai[bot] Aug 9, 2023
63aa9a9
Updated pkg/openapi/fixtures/v3.0.0/example_oas7.graphql
sweep-ai[bot] Aug 9, 2023
1023a20
Updated pkg/openapi/openapi_test.go
sweep-ai[bot] Aug 9, 2023
5b6f17c
Updated pkg/openapi/openapi_test.go
sweep-ai[bot] Aug 9, 2023
af47a4f
Updated pkg/openapi/openapi_test.go
sweep-ai[bot] Aug 9, 2023
ed3003a
Updated pkg/openapi/openapi.go
sweep-ai[bot] Aug 9, 2023
db72282
Updated pkg/variablevalidator/variablevalidator_test.go
sweep-ai[bot] Aug 16, 2023
2d6f905
Appended new input type to testDefinition constant
sweep-ai[bot] Aug 16, 2023
20361c2
Removed unused constant and added nested field to TestInput
sweep-ai[bot] Aug 16, 2023
27f5afb
Added TestInput input type and corresponding test case
sweep-ai[bot] Aug 16, 2023
ca6fd46
Deleted pkg/subscription/handler.goorotherrelevantfile
sweep-ai[bot] Aug 16, 2023
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
Prev Previous commit
Next Next commit
Updated pkg/openapi/openapi_test.go
  • Loading branch information
sweep-ai[bot] authored Aug 9, 2023
commit 5b6f17c50e1ddf46931eeafe84ab7f53905c7c52
11 changes: 6 additions & 5 deletions pkg/openapi/openapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ func TestOpenAPI_v3_0_0(t *testing.T) {
testFixtureFile(t, "v3.0.0", "petstore.yaml")
})

t.Run("example_oas7.json", func(t *testing.T) {
// Source: https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/test/fixtures/example_oas7.json
// Updated expected output to include the description for the `Device` type
testFixtureFile(t, "v3.0.0", "example_oas7.json")
})
t.Run("example_oas7.json", func(t *testing.T) {
// Source: https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/test/fixtures/example_oas7.json
// Updated expected output to include the description for the `Device` type
// Expected output: "schema {\n query: Query\n mutation: Mutation\n}\n\ntype Query {\n \"Find a device by name.\"\n findDeviceByName(deviceName: String!): Device\n \"Return a device collection.\"\n findDevices: [Device]\n \"Return a user.\"\n user: User\n}\n\ntype Mutation {\n \"Create and return a device.\"\n createDevice(deviceInput: DeviceInput!): Device\n \"Replace a device by name.\"\n replaceDeviceByName(deviceInput: DeviceInput!, deviceName: String!): Device\n}\n\n\"A device is an object connected to the network\"\ntype Device {\n \"The device name in the network\"\n name: String!\n status: Boolean\n \"The device owner Name\"\n userName: String!\n}\n\ninput DeviceInput {\n name: String!\n status: Boolean\n userName: String!\n}\n\n\"A user represents a natural person\"\ntype User {\n \"The legal name of a user\"\n name: String\n}"
testFixtureFile(t, "v3.0.0", "example_oas7.json")
})

t.Run("EmployeesApiBasic.yaml", func(t *testing.T) {
// Source https://github.com/zosconnect/test-samples/blob/main/oas/EmployeesApiBasic.yaml
Expand Down