fixes
This commit is contained in:
@@ -415,6 +415,36 @@ func TestV1OpenAPIYAMLProcessDualIDsAndGatesDocumentsContracts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestV1OpenAPIYAMLLegacyProcessItemEprelShape locks LegacyProcessItem.eprel
|
||||
// to the live nested object from eprel.MergeInto / extractEPRELFromAttrs.
|
||||
func TestV1OpenAPIYAMLLegacyProcessItemEprelShape(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
root := mustParseOpenAPIRoot(t, v1OpenAPIYAML)
|
||||
comps, _ := root["components"].(map[string]any)
|
||||
schemas, _ := comps["schemas"].(map[string]any)
|
||||
item, _ := schemas["LegacyProcessItem"].(map[string]any)
|
||||
itemProps, _ := item["properties"].(map[string]any)
|
||||
eprel, _ := itemProps["eprel"].(map[string]any)
|
||||
eprelProps, _ := eprel["properties"].(map[string]any)
|
||||
if eprelProps == nil {
|
||||
t.Fatal("LegacyProcessItem.eprel.properties missing")
|
||||
}
|
||||
want := []string{"id", "label", "pdf", "energy_class", "energy_scale"}
|
||||
for _, key := range want {
|
||||
if _, ok := eprelProps[key]; !ok {
|
||||
t.Fatalf("LegacyProcessItem.eprel missing property %q (live shape)", key)
|
||||
}
|
||||
}
|
||||
if len(eprelProps) != len(want) {
|
||||
keys := make([]string, 0, len(eprelProps))
|
||||
for k := range eprelProps {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
t.Fatalf("LegacyProcessItem.eprel properties = %v, want exactly %v", keys, want)
|
||||
}
|
||||
}
|
||||
|
||||
// TestV1OpenAPIYAMLDocumentsAPIKeyCutoverReissue locks cutover honesty: legacy
|
||||
// API keys were not migrated and clients must create new keys.
|
||||
func TestV1OpenAPIYAMLDocumentsAPIKeyCutoverReissue(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user