remove the extra fields from Context struct
This commit is contained in:
@@ -21,7 +21,6 @@ type payload struct {
|
|||||||
Context struct {
|
Context struct {
|
||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Action string `json:"action"`
|
|
||||||
} `json:"context"`
|
} `json:"context"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,10 +62,10 @@ func (v *schemaValidator) Validate(ctx context.Context, url *url.URL, data []byt
|
|||||||
}
|
}
|
||||||
|
|
||||||
if payloadData.Context.Domain == "" {
|
if payloadData.Context.Domain == "" {
|
||||||
return fmt.Errorf("missing field Domain in context")
|
return model.NewBadReqErr(fmt.Errorf("missing field Domain in context"))
|
||||||
}
|
}
|
||||||
if payloadData.Context.Version == "" {
|
if payloadData.Context.Version == "" {
|
||||||
return fmt.Errorf("missing field Version in context")
|
return model.NewBadReqErr(fmt.Errorf("missing field Version in context"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract domain, version, and endpoint from the payload and uri.
|
// Extract domain, version, and endpoint from the payload and uri.
|
||||||
|
|||||||
Reference in New Issue
Block a user