Made the code compile (does not respect async setting yet)
@@ -491,7 +491,7 @@ func configureAPI(api *operations.WeaviateAPI) http.Handler {
UUID := connutils.GenerateUUID()
// Validate schema given in body with the weaviate schema
- validatedErr := validation.ValidateActionBody(params.HTTPRequest.Context(), params.Body, databaseSchema, dbConnector, serverConfig, principal.(*models.KeyTokenGetResponse))
+ validatedErr := validation.ValidateActionBody(params.HTTPRequest.Context(), params.Body.Action, databaseSchema, dbConnector, serverConfig, principal.(*models.KeyTokenGetResponse))
if validatedErr != nil {
return actions.NewWeaviateActionsCreateUnprocessableEntity().WithPayload(createErrorResponseObject(validatedErr.Error()))
}
@@ -506,9 +506,9 @@ func configureAPI(api *operations.WeaviateAPI) http.Handler {
// Make Action-Object
action := &models.Action{}
- action.AtClass = params.Body.AtClass
- action.AtContext = params.Body.AtContext
- action.Schema = params.Body.Schema
+ action.AtClass = params.Body.Action.AtClass
+ action.AtContext = params.Body.Action.AtContext
+ action.Schema = params.Body.Action.Schema
action.CreationTimeUnix = connutils.NowUnix()
action.LastUpdateTimeUnix = 0
action.Key = keyRef
@@ -789,7 +789,7 @@ func configureAPI(api *operations.WeaviateAPI) http.Handler {
keyToken := principal.(*models.KeyTokenGetResponse)
// Validate schema given in body with the weaviate schema
- validatedErr := validation.ValidateThingBody(params.HTTPRequest.Context(), params.Body, databaseSchema, dbConnector, serverConfig, keyToken)
+ validatedErr := validation.ValidateThingBody(params.HTTPRequest.Context(), params.Body.Thing, databaseSchema, dbConnector, serverConfig, keyToken)
if validatedErr != nil {
return things.NewWeaviateThingsCreateUnprocessableEntity().WithPayload(createErrorResponseObject(validatedErr.Error()))
}
@@ -804,9 +804,9 @@ func configureAPI(api *operations.WeaviateAPI) http.Handler {
// Make Thing-Object
thing := &models.Thing{}
- thing.Schema = params.Body.Schema
- thing.AtClass = params.Body.AtClass
- thing.AtContext = params.Body.AtContext
+ thing.Schema = params.Body.Thing.Schema
+ thing.AtClass = params.Body.Thing.AtClass
+ thing.AtContext = params.Body.Thing.AtContext
thing.CreationTimeUnix = connutils.NowUnix()
thing.LastUpdateTimeUnix = 0
thing.Key = keyRef
