Skip to content

Commit 98a2abc

Browse files
committed
simplify: raml08/raml08openapi3: update msaPaths()
1 parent 1d5631b commit 98a2abc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

raml08/raml08openapi3/operations.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ var (
5050
// using the `openapi3edit.OperationMore` struct: `path`, `method`, `summary`, `description`. OpenAPI
5151
// `summary` is populated by the `displayName` property.
5252
func msaPaths(basePath string, msa map[string]any, omSet *openapi3edit.OperationMoreSet) error {
53-
if omSet == nil {
54-
return ErrOperationMoreSetMissing
55-
} else if msa == nil {
53+
if len(msa) == 0 {
5654
return nil
57-
}
58-
if omSet.OperationMores == nil {
55+
} else if omSet == nil {
56+
return ErrOperationMoreSetMissing
57+
} else if omSet.OperationMores == nil {
5958
omSet.OperationMores = []openapi3edit.OperationMore{}
6059
}
6160
basePath = strings.TrimSpace(basePath)

0 commit comments

Comments
 (0)