Skip to content

Commit 0c87600

Browse files
authored
fix: OASF 0.3.1 support in API validator (#105)
Signed-off-by: András Jáky <ajaky@cisco.com>
1 parent 6ced907 commit 0c87600

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/validator/validation.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ func constructValidationURL(baseURL, schemaVersion string) string {
224224
normalizedURL = "http://" + normalizedURL
225225
}
226226

227+
// Determine the object type based on schema version
228+
// Version 0.3.1 uses "agent", while later versions use "record"
229+
objectType := "record"
230+
if schemaVersion == "0.3.1" || schemaVersion == "v0.3.1" {
231+
objectType = "agent"
232+
}
233+
227234
// Construct the full validation URL
228-
return fmt.Sprintf("%s/api/%s/validate/object/record", normalizedURL, schemaVersion)
235+
return fmt.Sprintf("%s/api/%s/validate/object/%s", normalizedURL, schemaVersion, objectType)
229236
}

0 commit comments

Comments
 (0)