remove the extra fields from Context struct

This commit is contained in:
AshwiniK-protean
2025-04-30 11:53:22 +05:30
parent 9e33cde649
commit a5ab4caf5f

View File

@@ -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.