Skip to content

Commit

Permalink
upgrade ndc-rest-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Apr 5, 2024
1 parent 500893f commit d7fedc0
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 43 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.21
toolchain go1.22.0

require (
github.com/hasura/ndc-rest-schema v0.0.0-20240403043119-75fbf0984119
github.com/hasura/ndc-sdk-go v1.0.1-0.20240331071727-9c3db01b3219
github.com/hasura/ndc-rest-schema v0.0.0-20240405055634-a7a70f6f8e61
github.com/hasura/ndc-sdk-go v1.0.1-0.20240405043618-e5c75fc1de6f
github.com/lmittmann/tint v1.0.4
github.com/stretchr/testify v1.9.0
gopkg.in/yaml.v3 v3.0.1
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ github.com/hasura/ndc-rest-schema v0.0.0-20240403025915-a07cf4007901 h1:wr48uZbZ
github.com/hasura/ndc-rest-schema v0.0.0-20240403025915-a07cf4007901/go.mod h1:jcUMvsv1DjSONUk713W+jDNRTE0UQDVqHg6bRHk+Dcc=
github.com/hasura/ndc-rest-schema v0.0.0-20240403043119-75fbf0984119 h1:Cl66wyJt257VnIc/86qm1ZOWlDFiG1Q1ztqCxuVKoIc=
github.com/hasura/ndc-rest-schema v0.0.0-20240403043119-75fbf0984119/go.mod h1:jcUMvsv1DjSONUk713W+jDNRTE0UQDVqHg6bRHk+Dcc=
github.com/hasura/ndc-rest-schema v0.0.0-20240403131929-71d91b71caf4 h1:eLMG3AEtT/PoF7k14L1cc3Vxe4/2FohrYul8wZz893s=
github.com/hasura/ndc-rest-schema v0.0.0-20240403131929-71d91b71caf4/go.mod h1:jcUMvsv1DjSONUk713W+jDNRTE0UQDVqHg6bRHk+Dcc=
github.com/hasura/ndc-rest-schema v0.0.0-20240405055634-a7a70f6f8e61 h1:qnoyA5bj31MQ/pfk5ZSXxvQYtIUl6OQ0ppf7Gp6Y5Qc=
github.com/hasura/ndc-rest-schema v0.0.0-20240405055634-a7a70f6f8e61/go.mod h1:3n+C8F5KNwfsUTU/Rgh2RB69HqRrulPvugvrc8I/bHo=
github.com/hasura/ndc-sdk-go v1.0.0 h1:vLbv1k1UIkIXUUrNzi3B4QvAqT1/q2xxlrzff8+Z6+E=
github.com/hasura/ndc-sdk-go v1.0.0/go.mod h1:EeM3hKbhCfBjDDva8mP4D2KeptTqAaxNqNw8rFQAnMs=
github.com/hasura/ndc-sdk-go v1.0.1-0.20240331071727-9c3db01b3219 h1:1HniD4n41sKrKaQIBGO71tivLM3m435FCIJNUKJTX2k=
github.com/hasura/ndc-sdk-go v1.0.1-0.20240331071727-9c3db01b3219/go.mod h1:fNEh1RbxSrZNDl9ejNsKEXuMPMHhmMk0gB4XAd1SAus=
github.com/hasura/ndc-sdk-go v1.0.1-0.20240405043618-e5c75fc1de6f h1:vMzFaHlxc2UfnYL5/gipRF+wl2O+Warg8QvIOTPr+qM=
github.com/hasura/ndc-sdk-go v1.0.1-0.20240405043618-e5c75fc1de6f/go.mod h1:fNEh1RbxSrZNDl9ejNsKEXuMPMHhmMk0gB4XAd1SAus=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
Expand Down
1 change: 1 addition & 0 deletions rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func createRequest(ctx context.Context, rawRequest *rest.Request, headers http.H
} else {
switch contentType {
case rest.ContentTypeFormURLEncoded:
// do nothing, body properties are moved to parameters
case rest.ContentTypeJSON:
bodyBytes, err := json.Marshal(data)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion rest/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewRESTConnector(opts ...Option) *RESTConnector {
func (c *RESTConnector) ParseConfiguration(ctx context.Context, configurationDir string) (*Configuration, error) {

restCapabilities := schema.CapabilitiesResponse{
Version: "0.1.1",
Version: "0.1.2",
Capabilities: schema.Capabilities{
Query: schema.QueryCapabilities{
Variables: schema.LeafCapability{},
Expand Down
2 changes: 1 addition & 1 deletion rest/testdata/jsonplaceholder/snapshots/capabilities
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.1",
"version": "0.1.2",
"capabilities": {
"query": {
"variables": {}
Expand Down
81 changes: 42 additions & 39 deletions rest/testdata/jsonplaceholder/snapshots/schema
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
{
"scalar_types": {
"BigInt": {
"Boolean": {
"representation": {
"type": "boolean"
},
"aggregate_functions": {},
"comparison_operators": {}
},
"Boolean": {
"Int32": {
"representation": {
"type": "boolean"
"type": "int32"
},
"aggregate_functions": {},
"comparison_operators": {}
},
"Int": {
"Int64": {
"representation": {
"type": "integer"
"type": "int64"
},
"aggregate_functions": {},
"comparison_operators": {}
Expand Down Expand Up @@ -45,7 +48,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand All @@ -63,7 +66,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
}
Expand Down Expand Up @@ -94,7 +97,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand All @@ -112,7 +115,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
}
Expand All @@ -125,7 +128,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand All @@ -134,7 +137,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand Down Expand Up @@ -183,7 +186,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand All @@ -201,7 +204,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
}
Expand All @@ -223,7 +226,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand All @@ -241,7 +244,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
}
Expand Down Expand Up @@ -281,7 +284,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "BigInt"
"name": "Int64"
}
}
},
Expand Down Expand Up @@ -438,7 +441,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -448,7 +451,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
}
Expand All @@ -469,7 +472,7 @@
"description": "The ID of the post to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -486,7 +489,7 @@
"description": "post id",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -508,7 +511,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -518,7 +521,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
}
Expand All @@ -539,7 +542,7 @@
"description": "The ID of the comment to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -558,7 +561,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -568,7 +571,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
}
Expand All @@ -589,7 +592,7 @@
"description": "The ID of the album to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -606,7 +609,7 @@
"description": "post id",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -628,7 +631,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -638,7 +641,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
}
Expand All @@ -659,7 +662,7 @@
"description": "The ID of the photo to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -678,7 +681,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -688,7 +691,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
}
Expand All @@ -709,7 +712,7 @@
"description": "The ID of the todo to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -728,7 +731,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -738,7 +741,7 @@
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
}
Expand All @@ -759,7 +762,7 @@
"description": "The ID of the user to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand Down Expand Up @@ -802,7 +805,7 @@
"description": "The ID of the post to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -826,7 +829,7 @@
"description": "The ID of the post to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand All @@ -843,7 +846,7 @@
"description": "The ID of the post to retrieve",
"type": {
"type": "named",
"name": "Int"
"name": "Int32"
}
}
},
Expand Down

0 comments on commit d7fedc0

Please sign in to comment.