Skip to content

Commit e3c42ee

Browse files
Update sunset.go
1 parent 9cd52d2 commit e3c42ee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/cli/internal/openapi/sunset/sunset.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,16 @@ func successResponseExtensions(responsesMap map[string]*openapi3.ResponseRef) ma
116116
// with the oldest date in their keys.
117117
//
118118
// The function sorts content keys by date (in YYYY-MM-DD format) if present, with older dates taking
119-
// precedence. If multiple keys contain dates, it selects the entry with the earliest date. If no dates
120-
// are found, it selects the first content entry that would sort before entries with dates.
119+
// precedence. If multiple keys contain dates, it selects the entry with the earliest date.
121120
//
122121
// Parameters:
123122
// - content: An OpenAPI content map with media types as keys and schema objects as values
124123
//
125124
// Returns:
126125
// - A map of extension names to their values from the selected content entry,
127126
// or nil if the content map is empty or the selected entry has no extensions
127+
//
128+
// Assumption: the older version will have the earliest sunset date.
128129
func contentExtensions(content openapi3.Content) map[string]any {
129130
keysContent := slices.Collect(maps.Keys(content))
130131
// Regex to find a date in YYYY-MM-DD format.

0 commit comments

Comments
 (0)