Skip to content

Commit

Permalink
generate: add check when reading api-version
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyeqf committed Oct 13, 2023
1 parent 9f271ee commit 7528ee2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func NewResourceFromExample(filepath string) (*Resource, error) {
}
mappings = append(mappings, GetKeyValueMappings(body, "")...)

apiVersion = parametersMap["api-version"].(string)
if apiVer, ok := parametersMap["api-version"].(string); ok {
apiVersion = apiVer
}

}
}

Expand Down

0 comments on commit 7528ee2

Please sign in to comment.