mrutkows closed pull request #642: Fixes Delete unused marshal and unmarshal
methods... #323
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/642
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/parsers/parameters.go b/parsers/parameters.go
index 69cb467..e9bc1ca 100644
--- a/parsers/parameters.go
+++ b/parsers/parameters.go
@@ -290,46 +290,6 @@ func ResolveParameter(paramName string, param *Parameter,
filePath string) (inte
return value, errorParser
}
-// Provide custom Parameter marshalling and unmarshalling
-type ParsedParameter Parameter
-
-func (n *Parameter) UnmarshalYAML(unmarshal func(interface{}) error) error {
- var aux ParsedParameter
-
- // Attempt to unmarshal the multi-line schema
- if err := unmarshal(&aux); err == nil {
- n.multiline = true
- n.Type = aux.Type
- n.Description = aux.Description
- n.Value = aux.Value
- n.Required = aux.Required
- n.Default = aux.Default
- n.Status = aux.Status
- n.Schema = aux.Schema
- return nil
- }
-
- // If we did not find the multi-line schema, assume in-line (or
single-line) schema
- var inline interface{}
- if err := unmarshal(&inline); err != nil {
- return err
- }
-
- n.Value = inline
- n.multiline = false
- return nil
-}
-
-func (n *Parameter) MarshalYAML() (interface{}, error) {
- if _, ok := n.Value.(string); len(n.Type) == 0 && len(n.Description) ==
0 && ok {
- if !n.Required && len(n.Status) == 0 && n.Schema == nil {
- return n.Value.(string), nil
- }
- }
-
- return n, nil
-}
-
// Provides debug/trace support for Parameter type
func dumpParameter(paramName string, param *Parameter, separator string) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services